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

#compdef must be the first line #4015

Merged
merged 1 commit into from
Mar 28, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
#compdef must be the first line
  • Loading branch information
jat001 authored Mar 28, 2019
commit f64b343965798fccadba3f9a3172912d4a13e1ca
11 changes: 9 additions & 2 deletions cmd/minikube/cmd/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@ func GenerateBashCompletion(w io.Writer, cmd *cobra.Command) error {

// GenerateZshCompletion generates the completion for the zsh shell
func GenerateZshCompletion(out io.Writer, cmd *cobra.Command) error {
zshInitialization := `#compdef minikube
zshAutoloadTag := `#compdef minikube
`

zshInitialization := `
__minikube_bash_source() {
alias shopt=':'
alias _expand=_bash_expand
Expand Down Expand Up @@ -239,7 +241,12 @@ __minikube_convert_bash_to_zsh() {
<<'BASH_COMPLETION_EOF'
`

_, err := out.Write([]byte(boilerPlate))
_, err := out.Write([]byte(zshAutoloadTag))
if err != nil {
return err
}

_, err = out.Write([]byte(boilerPlate))
if err != nil {
return err
}
Expand Down