aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/urfave/cli/command.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/urfave/cli/command.go')
-rw-r--r--vendor/github.com/urfave/cli/command.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/vendor/github.com/urfave/cli/command.go b/vendor/github.com/urfave/cli/command.go
index 84946e7..23de294 100644
--- a/vendor/github.com/urfave/cli/command.go
+++ b/vendor/github.com/urfave/cli/command.go
@@ -59,6 +59,11 @@ type Command struct {
// Full name of command for help, defaults to full command name, including parent commands.
HelpName string
commandNamePath []string
+
+ // CustomHelpTemplate the text template for the command help topic.
+ // cli.go uses text/template to render templates. You can
+ // render custom help text by setting this variable.
+ CustomHelpTemplate string
}
type CommandsByName []Command
@@ -192,8 +197,6 @@ func (c Command) Run(ctx *Context) (err error) {
if c.Before != nil {
err = c.Before(context)
if err != nil {
- fmt.Fprintln(context.App.Writer, err)
- fmt.Fprintln(context.App.Writer)
ShowCommandHelp(context, c.Name)
HandleExitCoder(err)
return err
@@ -250,6 +253,7 @@ func (c Command) startApp(ctx *Context) error {
// set CommandNotFound
app.CommandNotFound = ctx.App.CommandNotFound
+ app.CustomAppHelpTemplate = c.CustomHelpTemplate
// set the flags and commands
app.Commands = c.Subcommands