Decouple help printer for custom templates

This commit is contained in:
Robert Liebowitz 2019-01-27 10:38:23 -05:00
parent a221e662f1
commit e2a8dfe314

View File

@ -187,7 +187,7 @@ 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 != "" { if c.CustomHelpTemplate != "" {
HelpPrinterCustom(ctx.App.Writer, c.CustomHelpTemplate, c, nil) HelpPrinter(ctx.App.Writer, c.CustomHelpTemplate, c)
} else { } else {
HelpPrinter(ctx.App.Writer, CommandHelpTemplate, c) HelpPrinter(ctx.App.Writer, CommandHelpTemplate, c)
} }
@ -261,7 +261,7 @@ func printHelpCustom(out io.Writer, templ string, data interface{}, customFunc m
} }
func printHelp(out io.Writer, templ string, data interface{}) { func printHelp(out io.Writer, templ string, data interface{}) {
printHelpCustom(out, templ, data, nil) HelpPrinterCustom(out, templ, data, nil)
} }
func checkVersion(c *Context) bool { func checkVersion(c *Context) bool {