Skip to content

Commit

Permalink
Merge pull request #4169 from superbrothers/fix-completion
Browse files Browse the repository at this point in the history
🌱 Make clusterctl completion zsh work with sourcing
  • Loading branch information
k8s-ci-robot authored Feb 11, 2021
2 parents bfc1498 + 72a8bfc commit 4e6fe8b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/clusterctl/cmd/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ func runCompletionZsh(out io.Writer, cmd *cobra.Command) error {
if err != nil {
return err
}
fmt.Fprintf(out, "%s\n%s%s", string(line), completionBoilerPlate, b.String())
fmt.Fprintf(out, "%s\n%s%s\n", string(line), completionBoilerPlate, b.String())

// Cobra doesn't source zsh completion file, explicitly doing it here
fmt.Fprintln(out, "compdef _clusterctl clusterctl")

return nil
}

0 comments on commit 4e6fe8b

Please sign in to comment.