From 717619095e8b7040a67bfd27766679e7f45ea8aa Mon Sep 17 00:00:00 2001 From: Eric Paris Date: Fri, 11 Sep 2015 18:27:37 -0400 Subject: [PATCH] No leading newline if Short and Long both unset Before --help would start ``` Usage: command [flags] [...] ``` After --help will show ``` Usage: command [flags] [...] ``` --- command.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/command.go b/command.go index 4569fe5..641dc1e 100644 --- a/command.go +++ b/command.go @@ -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}}` } }