add helpCommand check to fish completions.

This commit is contained in:
Tim Reddehase 2018-09-25 10:46:53 +02:00
parent e949e84978
commit 65eca9e4ba

View file

@ -103,8 +103,7 @@ func subCommandPath(rootCmd *Command, cmd *Command) string {
func rangeCommands(cmd *Command, callback func(subCmd *Command)) { func rangeCommands(cmd *Command, callback func(subCmd *Command)) {
for _, subCmd := range cmd.Commands() { for _, subCmd := range cmd.Commands() {
// TODO: for merging to cobra: add || subCmd == cmd.helpCommand if !subCmd.IsAvailableCommand() || subCmd == cmd.helpCommand {
if !subCmd.IsAvailableCommand() {
continue continue
} }
callback(subCmd) callback(subCmd)