add helpCommand check to fish completions.

This commit is contained in:
Tim Reddehase 2018-09-25 10:46:53 +02:00 committed by David Gillies
parent 8e081ca4ed
commit bbc741686f
No known key found for this signature in database
GPG key ID: BD350530941BDC96

View file

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