diff --git a/zsh_completions.md b/zsh_completions.md index df9c2eac..d21f58c8 100644 --- a/zsh_completions.md +++ b/zsh_completions.md @@ -4,6 +4,14 @@ Cobra supports native Zsh completion generated from the root `cobra.Command`. The generated completion script should be put somewhere in your `$fpath` named `_`. +```go +// Output to given io.Writer +rootCmd.GenZshCompletion(os.Stdout) + +// Output to given file +rootCmd.GenZshCompletionFile("/path/to/fpath/_your_command") +``` + ### What's Supported * Completion for all non-hidden subcommands using their `.Short` description.