From 9ced97f90c5d958ee29d48d4a9f89612a359083f Mon Sep 17 00:00:00 2001 From: Sam Ghods Date: Wed, 3 Sep 2014 01:24:07 -0700 Subject: [PATCH] Print Long description when printing Help, fixes #20 --- command.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/command.go b/command.go index dece3258..d6de8c6f 100644 --- a/command.go +++ b/command.go @@ -139,7 +139,7 @@ func (c *Command) HelpFunc() func(*Command, []string) { return func(c *Command, args []string) { if len(args) == 0 { // Help called without any topic, calling on root - c.Root().Usage() + c.Root().Help() return } @@ -213,7 +213,7 @@ func (c *Command) HelpTemplate() string { return c.parent.HelpTemplate() } else { return `{{.Long | trim}} -{{if .Runnable}}{{.UsageString}}{{end}} +{{if or .Runnable .HasSubCommands}}{{.UsageString}}{{end}} ` } } @@ -402,7 +402,7 @@ func (c *Command) Execute() (err error) { if c.Runnable() { err = c.execute([]string(nil)) } else { - c.Usage() + c.Help() } } else { err = c.findAndExecute(args)