File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 29
29
completionNoDesc bool //Disable completion description for shells that support it
30
30
)
31
31
32
- // NewCommand created a new `version ` command
32
+ // NewCommand created a new `completion ` command
33
33
func NewCommand () * cobra.Command {
34
34
command := & cobra.Command {
35
35
Use : "completion [bash|zsh|fish] [--no-descriptions]" ,
@@ -47,7 +47,7 @@ func NewCommand() *cobra.Command {
47
47
}
48
48
49
49
func run (cmd * cobra.Command , args []string ) {
50
- if completionNoDesc && (args [0 ] == "bash" || args [ 0 ] == "zsh" ) {
50
+ if completionNoDesc && (args [0 ] == "bash" ) {
51
51
feedback .Errorf ("Error: command description is not supported by %v" , args [0 ])
52
52
os .Exit (errorcodes .ErrGeneric )
53
53
}
@@ -56,7 +56,11 @@ func run(cmd *cobra.Command, args []string) {
56
56
cmd .Root ().GenBashCompletion (os .Stdout )
57
57
break
58
58
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
+ }
60
64
break
61
65
case "fish" :
62
66
buf := new (bytes.Buffer )
You can’t perform that action at this time.
0 commit comments