From bc62fff34a6edb00137c340ec8bb56d7fde8a652 Mon Sep 17 00:00:00 2001 From: remiposo <57336808+remiposo@users.noreply.github.com> Date: Fri, 4 Nov 2022 04:54:49 +0000 Subject: [PATCH] Fix: Avoid duplication of help commands --- help.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/help.go b/help.go index 6dc593b343..2ccd3b71e6 100644 --- a/help.go +++ b/help.go @@ -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 {