No leading newline if Short and Long both unset

Before --help would start
```

Usage:
  command [flags]
  [...]
```

After --help will show
```
Usage:
  command [flags]
  [...]
```
This commit is contained in:
Eric Paris 2015-09-11 18:27:37 -04:00
parent 42498ec777
commit 717619095e
1 changed files with 3 additions and 2 deletions

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}}`
}
}