-
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
Completion support for zsh #1012
Labels
Comments
Agreed. Both the kubectl and minikube zsh completion should be same (except s/minikube/kubectl/) and we can just copy that over. We would absolutely be open to a PR for either, or both. When I wrote the minikube completion, I used kubectl completion as the reference, and when I wrote the skaffold completion, I used minikube as the reference :) |
r2d4
added
good first issue
Good for newcomers
cmd/completion
kind/feature-request
labels
Sep 21, 2018
@GeertJohan Would you like to contribute this feature? |
varunkashyap
added a commit
to varunkashyap/skaffold
that referenced
this issue
Oct 26, 2018
We currently only support bash completion scripts, however as raised in part 1 of GoogleContainerTools#1012 this means we output bash completion script irrespective what the user types as the shell. This PR makes bash explicit, introduces RunE instead of Run to propagate error is unsupported shell is entered by the user.
varunkashyap
added a commit
to varunkashyap/skaffold
that referenced
this issue
Oct 26, 2018
We currently only support bash completion scripts, however as raised as part 1 of GoogleContainerTools#1012 this means we output bash completion script irrespective what the user types as the shell. This PR makes bash explicit, introduces valid args and checks for length and presence of valid args
corneliusweig
pushed a commit
to corneliusweig/skaffold
that referenced
this issue
Jan 24, 2019
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, the
skaffold completion
subcommand ignores any arguments and always outputs bash completion. Sinceskaffold completion zsh
didn't error, I expected it to return a valid zsh completion script only to find out it was running the bash completion script.I thinks two seperate PR's can be created to fix this issue.
The first is very simple and just manages expectation. The shell argument to
skaffold completion SHELL
should be validated; if it's not "bash" then write an error and exit with non-zero exitcode. If maintainers agree with this I would like to create a PR for it. It's simple enough to make it in the next release.The second PR would actually add zsh completion.
I've seen cobra supports very rudimentary Zsh now, just command structure. I guess for that reason both kubectl and minikube use a converter/wrapper from bash to zsh.
kubectl: https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/completion.go
minikube: https://github.com/kubernetes/minikube/blob/master/cmd/minikube/cmd/completion.go
They both seem very similar. Probably we could just diff the files and pick one based on which is best for skaffold.
The text was updated successfully, but these errors were encountered: