@ -102,12 +102,12 @@ func newCompletionCmd(out io.Writer) *cobra.Command {
Short : "generate autocompletion script for bash" ,
Short : "generate autocompletion script for bash" ,
Long : bashCompDesc ,
Long : bashCompDesc ,
Args : require . NoArgs ,
Args : require . NoArgs ,
DisableFlagsInUseLine : true ,
ValidArgsFunction : noCompletions ,
ValidArgsFunction : noCompletions ,
RunE : func ( cmd * cobra . Command , args [ ] string ) error {
RunE : func ( cmd * cobra . Command , args [ ] string ) error {
return runCompletionBash ( out , cmd )
return runCompletionBash ( out , cmd )
} ,
} ,
}
}
bash . Flags ( ) . BoolVar ( & disableCompDescriptions , noDescFlagName , false , noDescFlagText )
zsh := & cobra . Command {
zsh := & cobra . Command {
Use : "zsh" ,
Use : "zsh" ,
@ -151,7 +151,7 @@ func newCompletionCmd(out io.Writer) *cobra.Command {
}
}
func runCompletionBash ( out io . Writer , cmd * cobra . Command ) error {
func runCompletionBash ( out io . Writer , cmd * cobra . Command ) error {
err := cmd . Root ( ) . GenBashCompletion ( out )
err := cmd . Root ( ) . GenBashCompletion V2 ( out , ! disableCompDescriptions )
// In case the user renamed the helm binary (e.g., to be able to run
// In case the user renamed the helm binary (e.g., to be able to run
// both helm2 and helm3), we hook the new binary name to the completion function
// both helm2 and helm3), we hook the new binary name to the completion function