mirror of
https://github.com/spf13/cobra
synced 2024-11-24 14:47:12 +00:00
Merge pull request #151 from eparis/no-newline-without-short
No leading newline if Short and Long both unset
This commit is contained in:
commit
85bb343e9c
1 changed files with 3 additions and 2 deletions
|
@ -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 a new issue