diff --git a/ffcli/command.go b/ffcli/command.go index 5254acc..2484d1c 100644 --- a/ffcli/command.go +++ b/ffcli/command.go @@ -200,6 +200,12 @@ func (e NoExecError) Error() string { func DefaultUsageFunc(c *Command) string { var b strings.Builder + if c.ShortHelp != "" { + fmt.Fprintf(&b, "DESCRIPTION\n") + fmt.Fprintf(&b, " %s\n", c.ShortHelp) + fmt.Fprintf(&b, "\n") + } + fmt.Fprintf(&b, "USAGE\n") if c.ShortUsage != "" { fmt.Fprintf(&b, " %s\n", c.ShortUsage) diff --git a/ffcli/command_test.go b/ffcli/command_test.go index 9d9aa90..5637d59 100644 --- a/ffcli/command_test.go +++ b/ffcli/command_test.go @@ -593,6 +593,9 @@ func assertStringSlice(t *testing.T, want, have []string) { } var defaultUsageFuncOutput = strings.TrimSpace(` +DESCRIPTION + Some short help. + USAGE TestHelpUsage [flags]