Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #1565 from remiposo/avoid_duplication_of_help_comm…
…ands

Fix: Avoid duplication of help commands
  • Loading branch information
dearchap committed Nov 4, 2022
2 parents d0aeb4d + bc62fff commit e194a18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion help.go
Expand Up @@ -246,7 +246,7 @@ func ShowCommandHelp(ctx *Context, command string) error {
}
for _, c := range commands {
if c.HasName(command) {
if !ctx.App.HideHelpCommand && !c.HasName(helpName) && len(c.Subcommands) != 0 {
if !ctx.App.HideHelpCommand && !c.HasName(helpName) && len(c.Subcommands) != 0 && c.Command(helpName) == nil {
c.Subcommands = append(c.Subcommands, helpCommandDontUse)
}
if !ctx.App.HideHelp && HelpFlag != nil {
Expand Down

0 comments on commit e194a18

Please sign in to comment.