File tree 1 file changed +6
-3
lines changed
1 file changed +6
-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
33
32
func NewCommand () * cobra.Command {
34
33
command := & cobra.Command {
35
34
Use : "completion [bash|zsh|fish] [--no-descriptions]" ,
@@ -47,7 +46,7 @@ func NewCommand() *cobra.Command {
47
46
}
48
47
49
48
func run (cmd * cobra.Command , args []string ) {
50
- if completionNoDesc && (args [0 ] == "bash" || args [ 0 ] == "zsh" ) {
49
+ if completionNoDesc && (args [0 ] == "bash" ) {
51
50
feedback .Errorf ("Error: command description is not supported by %v" , args [0 ])
52
51
os .Exit (errorcodes .ErrGeneric )
53
52
}
@@ -56,7 +55,11 @@ func run(cmd *cobra.Command, args []string) {
56
55
cmd .Root ().GenBashCompletion (os .Stdout )
57
56
break
58
57
case "zsh" :
59
- cmd .Root ().GenZshCompletion (os .Stdout )
58
+ if completionNoDesc {
59
+ cmd .Root ().GenZshCompletionNoDesc (os .Stdout )
60
+ } else {
61
+ cmd .Root ().GenZshCompletion (os .Stdout )
62
+ }
60
63
break
61
64
case "fish" :
62
65
buf := new (bytes.Buffer )
You can’t perform that action at this time.
0 commit comments