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:
parent
42498ec777
commit
717619095e
@ -284,8 +284,9 @@ func (c *Command) HelpTemplate() string {
|
|||||||
if c.HasParent() {
|
if c.HasParent() {
|
||||||
return c.parent.HelpTemplate()
|
return c.parent.HelpTemplate()
|
||||||
} else {
|
} else {
|
||||||
return `{{with or .Long .Short }}{{. | trim}}{{end}}
|
return `{{with or .Long .Short }}{{. | trim}}
|
||||||
{{if or .Runnable .HasSubCommands}}{{.UsageString}}{{end}}`
|
|
||||||
|
{{end}}{{if or .Runnable .HasSubCommands}}{{.UsageString}}{{end}}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user