File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-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
3332func NewCommand () * cobra.Command {
3433 command := & cobra.Command {
3534 Use : "completion [bash|zsh|fish] [--no-descriptions]" ,
@@ -47,7 +46,7 @@ func NewCommand() *cobra.Command {
4746}
4847
4948func run (cmd * cobra.Command , args []string ) {
50- if completionNoDesc && (args [0 ] == "bash" || args [ 0 ] == "zsh" ) {
49+ if completionNoDesc && (args [0 ] == "bash" ) {
5150 feedback .Errorf ("Error: command description is not supported by %v" , args [0 ])
5251 os .Exit (errorcodes .ErrGeneric )
5352 }
@@ -56,7 +55,11 @@ func run(cmd *cobra.Command, args []string) {
5655 cmd .Root ().GenBashCompletion (os .Stdout )
5756 break
5857 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+ }
6063 break
6164 case "fish" :
6265 buf := new (bytes.Buffer )
You can’t perform that action at this time.
0 commit comments