Decouple help printer for custom templates
This commit is contained in:
parent
a221e662f1
commit
e2a8dfe314
4
help.go
4
help.go
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user