Skip to content

Commit c4b26f1

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

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

cli/completion/completion.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var (
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
3333
func 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

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

0 commit comments

Comments
 (0)