Skip to content
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 completion requires calling compdef _ko ko explicitly after sourcing #871

Closed
antoineco opened this issue Oct 27, 2022 · 1 comment
Closed

Comments

@antoineco
Copy link
Contributor

Unlike other tools of the Kubernetes ecosystem that use Cobra, the Zsh completion script generated by ko completion zsh does not call compdef _kind, so the user must manually call compdef _ko ko after sourcing the completion.

$ ko completion zsh --help
[...]

To load completions in your current shell session:

	source <(ko completion zsh); compdef _ko ko

[...]

This is a bit counter-intuitive and could easily be addressed it seems.


Below is a comparison of outputs for <tool> completion zsh:

kind: https://github.com/kubernetes-sigs/kind/blob/v0.17.0/pkg/cmd/kind/completion/zsh/zsh.go#L28-L38

#compdef _kind kind

ko:

#compdef ko
@antoineco
Copy link
Contributor Author

antoineco commented Oct 27, 2022

Turns out I'm in the wrong here: spf13/cobra#1690

Cobra doesn't add the underscored name anymore since v1.5.0 for good reasons. I guess I can live with that :)

Closing.

@antoineco antoineco closed this as not planned Won't fix, can't repro, duplicate, stale Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant