Skip to content

Commit

Permalink
fix: add zsh completion head
Browse files Browse the repository at this point in the history
  • Loading branch information
lizzy-0323 committed Nov 25, 2024
1 parent d8a8996 commit d1914af
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/cli/cmd/completion/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ func runCompletionBash(out io.Writer, boilerPlate string, cmd *cobra.Command) er
}

func runCompletionZsh(out io.Writer, boilerPlate string, cmd *cobra.Command) error {
// Add zsh completion header to specifiy the command to complete for zsh

Check failure on line 139 in internal/cli/cmd/completion/completion.go

View workflow job for this annotation

GitHub Actions / lint

`specifiy` is a misspelling of `specify` (misspell)
zshHead := fmt.Sprintf("#compdef %[1]s\ncompdef _%[1]s %[1]s\n", cmd.Name())
out.Write([]byte(zshHead))

Check failure on line 141 in internal/cli/cmd/completion/completion.go

View workflow job for this annotation

GitHub Actions / lint

Error return value of `out.Write` is not checked (errcheck)

if len(boilerPlate) == 0 {
boilerPlate = defaultBoilerPlate
}
Expand Down

0 comments on commit d1914af

Please sign in to comment.