1
0
Fork 0
mirror of https://github.com/spf13/cobra synced 2025-04-21 22:27:18 +00:00

Merge pull request from eparis/no-newline-without-short

No leading newline if Short and Long both unset
This commit is contained in:
Eric Paris 2015-09-11 17:46:37 -05:00
commit 85bb343e9c

View file

@ -284,8 +284,9 @@ func (c *Command) HelpTemplate() string {
if c.HasParent() {
return c.parent.HelpTemplate()
} else {
return `{{with or .Long .Short }}{{. | trim}}{{end}}
{{if or .Runnable .HasSubCommands}}{{.UsageString}}{{end}}`
return `{{with or .Long .Short }}{{. | trim}}
{{end}}{{if or .Runnable .HasSubCommands}}{{.UsageString}}{{end}}`
}
}