-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- v1.1.1
- v1.1.0
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v0.30.2
- v0.30.1
- v0.30.0
- v0.29.1
- v0.29.0
- v0.28.5
- v0.28.4
- v0.28.3
- v0.28.2
- v0.28.1
- v0.28.0
- v0.27.0
- v0.26.0
- v0.25.3
- v0.25.2
- v0.25.1
- v0.25.0
- v0.24.5
- v0.24.4
- v0.24.3
- v0.24.2
- v0.24.1
- v0.24.0
- v0.23.0
- v0.22.0
- v0.21.0
- v0.20.3
- v0.20.2
- v0.20.1
- v0.20.0
- v0.19.1
- v0.19.0
- v0.18.1
- v0.18.0
- v0.17.1
- v0.17.0
- v0.16.0
- v0.15.1
- v0.15.0
- v0.14.0
- v0.13.5
- v0.13.4
- v0.13.3
- v0.13.2
- v0.13.1
- v0.13.0
- v0.12.9
- v0.12.8
- v0.12.7
- v0.12.6
- v0.12.5
- v0.12.4
- v0.12.3
- v0.12.2
- v0.12.1
- v0.12.0
- v0.11.8
- v0.11.7
- v0.11.6
- v0.11.5
- v0.11.4
- v0.11.3
- v0.11.2
- v0.11.1
- v0.11.0
- v0.10.3
- v0.10.2
- v0.10.1
- v0.10.0
- v0.9.1
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package module | ||
|
||
import ( | ||
"github.com/rsteube/carapace" | ||
"github.com/rsteube/carapace-bin/pkg/actions/net" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func ExecuteHttpServer() error { | ||
cmd := &cobra.Command{ | ||
Use: "http.server", | ||
Short: "simple http server", | ||
Run: func(cmd *cobra.Command, args []string) {}, | ||
} | ||
|
||
carapace.Gen(cmd).Standalone() | ||
|
||
cmd.Flags().StringP("bind", "b", "", "Specify alternate bind address") | ||
cmd.Flags().Bool("cgi", false, "Run as CGI Server") | ||
cmd.Flags().StringP("directory", "d", "", "Specify alternative directory") | ||
cmd.Flags().BoolP("help", "h", false, "show this help message and exit") | ||
|
||
carapace.Gen(cmd).FlagCompletion(carapace.ActionMap{ | ||
"directory": carapace.ActionDirectories(), | ||
}) | ||
|
||
carapace.Gen(cmd).PositionalCompletion( | ||
net.ActionPorts(), | ||
) | ||
|
||
return cmd.Execute() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters