kubectl should print usage at the bottom

Override the Usage: output using SetUsageTemplate. Just moved
the strings in the template to make sure we print Usage: at
the bottom of the output and not at the top.

Fixes issue 7496
This commit is contained in:
Davanum Srinivas
2016-05-15 22:46:46 -04:00
parent 4ee877c226
commit 91f16364b8
2 changed files with 31 additions and 3 deletions

View File

@@ -295,9 +295,7 @@ func (c *Command) HelpTemplate() string {
if c.HasParent() {
return c.parent.HelpTemplate()
}
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}}`
}
// Really only used when casting a command to a commander