-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zsh completions can't be sourced #522
Comments
hmm, I wonder if this is a bug upstream in cobra, we are generating these with that library |
/help |
@BenTheElder: Please ensure the request meets the requirements listed here. If this request no longer meets these requirements, the label can be removed In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Might be related to spf13/cobra#646 |
Did this work before? As afaik you don't source completions (as in bash) but instead add the folders containing them to fpath: https://github.com/zsh-users/zsh-completions/blob/master/zsh-completions-howto.org#telling-zsh-which-function-to-use-for-completing-a-command e.g:
|
👋 I added the autocompletion subcommand. If you run kind completion
There's a PR in |
Thanks @epk ! :-) |
/assign |
The upstream PR was closed. |
IMO it looks like we should probably encourage installing the completion script output instead, which |
I think the confusion comes from the fact that If you do that you miss the lovely note in the beginning with detailed explanation. Outputs kind shell completion for the given shell (bash or zsh)
This depends on the bash-completion binary. Example installation instructions:
# for bash users
$ kind completion bash > ~/.kind-completion
$ source ~/.kind-completion
# for zsh users
% kind completion zsh > /usr/local/share/zsh/site-functions/_kind
% autoload -U compinit && compinit
# or if zsh-completion is installed via homebrew
% kind completion zsh > "${fpath[1]}/_kind"
# or if you use oh-my-zsh (needs zsh-completions plugin)
% mkdir $ZSH/completions/
% kind completion zsh > $ZSH/completions/_kind
# for fish users
% kind completion fish > ~/.config/fish/completions/kind.fish I think if he order is swapped it'd be nicer:
|
That output comes from cobra. You may want to provide usability suggestions there: https://github.com/spf13/cobra |
What happened:
Running
source <(kind completion zsh)
fails with the following errorWhat you expected to happen:
The completions to import and be available
How to reproduce it (as minimally and precisely as possible):
Run
source <(kind completion zsh)
in zshAnything else we need to know?:
Environment:
kind version
): 0.3.0-alphakubectl version
): 1.14docker info
): 18.09.2/etc/os-release
): MacOS 10.14The text was updated successfully, but these errors were encountered: