mirror of
https://github.com/spf13/cobra
synced 2024-11-24 22:57:12 +00:00
Merge pull request #148 from tamird/trailing-spaces
trim trailing whitespace
This commit is contained in:
commit
42498ec777
1 changed files with 4 additions and 6 deletions
|
@ -248,8 +248,7 @@ func (c *Command) UsageTemplate() string {
|
||||||
if c.HasParent() {
|
if c.HasParent() {
|
||||||
return c.parent.UsageTemplate()
|
return c.parent.UsageTemplate()
|
||||||
} else {
|
} else {
|
||||||
return `{{ $cmd := . }}
|
return `{{ $cmd := . }}Usage:{{if .Runnable}}
|
||||||
Usage: {{if .Runnable}}
|
|
||||||
{{.UseLine}}{{if .HasFlags}} [flags]{{end}}{{end}}{{if .HasSubCommands}}
|
{{.UseLine}}{{if .HasFlags}} [flags]{{end}}{{end}}{{if .HasSubCommands}}
|
||||||
{{ .CommandPath}} [command]{{end}}{{if gt .Aliases 0}}
|
{{ .CommandPath}} [command]{{end}}{{if gt .Aliases 0}}
|
||||||
|
|
||||||
|
@ -286,8 +285,7 @@ func (c *Command) HelpTemplate() string {
|
||||||
return c.parent.HelpTemplate()
|
return c.parent.HelpTemplate()
|
||||||
} else {
|
} else {
|
||||||
return `{{with or .Long .Short }}{{. | trim}}{{end}}
|
return `{{with or .Long .Short }}{{. | trim}}{{end}}
|
||||||
{{if or .Runnable .HasSubCommands}}{{.UsageString}}{{end}}
|
{{if or .Runnable .HasSubCommands}}{{.UsageString}}{{end}}`
|
||||||
`
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue