Skip to content
Myr

Improve zsh completion documentation (#1169)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Marc Khouzam · committed by GitHub · parent 19e41cf · Browse files · 2 files+8 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>

Diff stats

2 files+8 added−2 removed

  • other:+8 added−2 removed

2 files+8 added−2 removed

modified:shell_completions.md+7 added-2 removed
31 unmodified lines
32 $ yourprogram completion bash > /usr/local/etc/bash_completion.d/yourprogram3334Zsh:3536$ source <(yourprogram completion zsh)36# If shell completion is not already enabled in your environment you will need37# to enable it. You can execute the following once:3839$ echo "autoload -U compinit; compinit" >> ~/.zshrc4041# To load completions for each session, execute once:42$ yourprogram completion zsh > "${fpath[1]}/_yourprogram"4344# You will need to start a new shell for this setup to take effect.4546Fish:4748$ yourprogram completion fish | source49
317 unmodified lines
367## Zsh completions368369Cobra supports native Zsh completion generated from the root `cobra.Command`.370The generated completion script should be put somewhere in your `$fpath` and be named366`_<yourProgram>`.371`_<yourProgram>`. You will need to start a new shell for the completions to become available.372373Zsh supports descriptions for completions. Cobra will provide the description automatically,374based on usage information. Cobra provides a way to completely disable such descriptions by375using `GenZshCompletionNoDesc()` or `GenZshCompletionFileNoDesc()`. You can choose to make
59 unmodified lines
modified:zsh_completions.md+1 added