From b52cca036aadab37c86db59b0e04b1a79d7ac380 Mon Sep 17 00:00:00 2001 From: Robert Liebowitz Date: Wed, 16 Oct 2019 07:24:21 -0400 Subject: [PATCH] Simplify duplicated function call --- help.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/help.go b/help.go index 06c526f..01c19aa 100644 --- a/help.go +++ b/help.go @@ -186,11 +186,13 @@ func ShowCommandHelp(ctx *Context, command string) error { for _, c := range ctx.App.Commands { if c.HasName(command) { - if c.CustomHelpTemplate != "" { - HelpPrinter(ctx.App.Writer, c.CustomHelpTemplate, c) - } else { - HelpPrinter(ctx.App.Writer, CommandHelpTemplate, c) + templ := c.CustomHelpTemplate + if templ == "" { + templ = CommandHelpTemplate } + + HelpPrinter(ctx.App.Writer, templ, c) + return nil } }