Skip to content

Commit

Permalink
#compdef must be the first line
Browse files Browse the repository at this point in the history
  • Loading branch information
jat001 committed Mar 28, 2019
1 parent b189947 commit f64b343
Showing 1 changed file with 9 additions and 2 deletions.
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

0 comments on commit f64b343

Please sign in to comment.