File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 2929 completionNoDesc bool //Disable completion description for shells that support it
3030)
3131
32- // NewCommand created a new `version ` command
32+ // NewCommand created a new `completion ` command
3333func NewCommand () * cobra.Command {
3434 command := & cobra.Command {
3535 Use : "completion [bash|zsh|fish] [--no-descriptions]" ,
@@ -47,7 +47,7 @@ func NewCommand() *cobra.Command {
4747}
4848
4949func run (cmd * cobra.Command , args []string ) {
50- if completionNoDesc && (args [0 ] == "bash" || args [ 0 ] == "zsh" ) {
50+ if completionNoDesc && (args [0 ] == "bash" ) {
5151 feedback .Errorf ("Error: command description is not supported by %v" , args [0 ])
5252 os .Exit (errorcodes .ErrGeneric )
5353 }
@@ -56,7 +56,11 @@ func run(cmd *cobra.Command, args []string) {
5656 cmd .Root ().GenBashCompletion (os .Stdout )
5757 break
5858 case "zsh" :
59- cmd .Root ().GenZshCompletion (os .Stdout )
59+ if completionNoDesc {
60+ cmd .Root ().GenZshCompletionNoDesc (os .Stdout )
61+ } else {
62+ cmd .Root ().GenZshCompletion (os .Stdout )
63+ }
6064 break
6165 case "fish" :
6266 buf := new (bytes.Buffer )
You can’t perform that action at this time.
0 commit comments