diff --git a/cmd/completion.go b/cmd/completion.go index 9f36a75b1a..ed2ef0052e 100644 --- a/cmd/completion.go +++ b/cmd/completion.go @@ -18,12 +18,14 @@ const ( $ brew install bash-completion $ source $(brew --prefix)/etc/bash_completion $ devspace completion bash > ~/.devspace-completion # for bash users + $ devspace completion fish > ~/.devspace-completion # for fish users $ devspace completion zsh > ~/.devspace-completion # for zsh users $ source ~/.devspace-completion Ubuntu: $ apt-get install bash-completion $ source /etc/bash-completion $ source <(devspace completion bash) # for bash users + $ devspace completion fish | source # for fish users $ source <(devspace completion zsh) # for zsh users Additionally, you may want to output the completion to a file and source in your .bashrc @@ -42,7 +44,7 @@ func NewCompletionCmd() *cobra.Command { } return cobra.OnlyValidArgs(cmd, args) }, - ValidArgs: []string{"bash", "zsh"}, + ValidArgs: []string{"bash", "fish", "zsh"}, Short: "Outputs shell completion for the given shell (bash or zsh)", Long: longDescription, RunE: completion, @@ -53,6 +55,8 @@ func completion(cmd *cobra.Command, args []string) error { switch args[0] { case "bash": return rootCmd(cmd).GenBashCompletion(os.Stdout) + case "fish": + return rootCmd(cmd).GenFishCompletion(os.Stdout, true) case "zsh": err := rootCmd(cmd).GenZshCompletion(os.Stdout) if err != nil { diff --git a/docs/pages/cli.md b/docs/pages/cli.md index 962cc7d3b6..c1aa658506 100644 --- a/docs/pages/cli.md +++ b/docs/pages/cli.md @@ -3,14 +3,18 @@ title: "devspace --help" sidebar_label: devspace --- +## devspace + +Welcome to the DevSpace! + ### Synopsis -``` + DevSpace accelerates developing, deploying and debugging applications with Docker and Kubernetes. Get started by running the init command in one of your projects: devspace init -``` -### Global Flags +### Options + ``` --debug Prints the stack trace if an error occurs --disable-profile-activation If true will ignore all profile activations @@ -25,3 +29,11 @@ DevSpace accelerates developing, deploying and debugging applications with Docke -s, --switch-context Switches and uses the last kube context and namespace that was used to deploy the DevSpace project --var strings Variables to override during execution (e.g. --var=MYVAR=MYVALUE) ``` + +``` + +``` + + +## Flags +## Global & Inherited Flags \ No newline at end of file diff --git a/docs/pages/cli/devspace_completion.md b/docs/pages/cli/devspace_completion.md index 616a0423ca..e969f42be0 100644 --- a/docs/pages/cli/devspace_completion.md +++ b/docs/pages/cli/devspace_completion.md @@ -21,12 +21,14 @@ Outputs shell completion for the given shell (bash or zsh) $ brew install bash-completion $ source $(brew --prefix)/etc/bash_completion $ devspace completion bash > ~/.devspace-completion # for bash users + $ devspace completion fish > ~/.devspace-completion # for fish users $ devspace completion zsh > ~/.devspace-completion # for zsh users $ source ~/.devspace-completion Ubuntu: $ apt-get install bash-completion $ source /etc/bash-completion $ source <(devspace completion bash) # for bash users + $ devspace completion fish | source # for fish users $ source <(devspace completion zsh) # for zsh users Additionally, you may want to output the completion to a file and source in your .bashrc