Skip to content

Commit 4031d4c

Browse files
committed
Call the standard ShowCommandHelp() function for subcommands too
1 parent a107ee4 commit 4031d4c

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

help.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,16 +125,8 @@ func helpCommandAction(ctx context.Context, cmd *Command) error {
125125

126126
// Case 3, 5
127127
if len(cmd.VisibleCommands()) == 0 {
128-
129-
tmpl := cmd.CustomHelpTemplate
130-
if tmpl == "" {
131-
tmpl = CommandHelpTemplate
132-
}
133-
134128
tracef("running HelpPrinter with command %[1]q", cmd.Name)
135-
HelpPrinter(cmd.Root().Writer, tmpl, cmd)
136-
137-
return nil
129+
return ShowCommandHelp(ctx, cmd.parent, cmd.Name)
138130
}
139131

140132
tracef("running ShowSubcommandHelp")

0 commit comments

Comments
 (0)