Skip to content

Commit 4915497

Browse files
committed
add --no-descriptions also for zsh
1 parent 4b65a3f commit 4915497

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

cli/completion/completion.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ var (
2929
completionNoDesc bool //Disable completion description for shells that support it
3030
)
3131

32-
// NewCommand created a new `version` command
3332
func 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

4948
func 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)

0 commit comments

Comments
 (0)