Simplify duplicated function call
This commit is contained in:
parent
e2a8dfe314
commit
b52cca036a
10
help.go
10
help.go
@ -186,11 +186,13 @@ func ShowCommandHelp(ctx *Context, command string) error {
|
|||||||
|
|
||||||
for _, c := range ctx.App.Commands {
|
for _, c := range ctx.App.Commands {
|
||||||
if c.HasName(command) {
|
if c.HasName(command) {
|
||||||
if c.CustomHelpTemplate != "" {
|
templ := c.CustomHelpTemplate
|
||||||
HelpPrinter(ctx.App.Writer, c.CustomHelpTemplate, c)
|
if templ == "" {
|
||||||
} else {
|
templ = CommandHelpTemplate
|
||||||
HelpPrinter(ctx.App.Writer, CommandHelpTemplate, c)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HelpPrinter(ctx.App.Writer, templ, c)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user