Skip to content

Commit d1914af

Browse files
committed
fix: add zsh completion head
1 parent d8a8996 commit d1914af

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/cli/cmd/completion/completion.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ func runCompletionBash(out io.Writer, boilerPlate string, cmd *cobra.Command) er
136136
}
137137

138138
func runCompletionZsh(out io.Writer, boilerPlate string, cmd *cobra.Command) error {
139+
// Add zsh completion header to specifiy the command to complete for zsh
140+
zshHead := fmt.Sprintf("#compdef %[1]s\ncompdef _%[1]s %[1]s\n", cmd.Name())
141+
out.Write([]byte(zshHead))
142+
139143
if len(boilerPlate) == 0 {
140144
boilerPlate = defaultBoilerPlate
141145
}

0 commit comments

Comments
 (0)