Replace tab with spaces in usage output

All output of the usage / --help output uses spaces, and having a tab
in the output can be somewhat cumbersome (e.g. our YAML docs generator
doesn't like them, and copy/pasing the output in iTerm produces a warning).

This patch changes the output to use two spaces instead.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2020-10-02 15:41:17 +02:00
parent 9b92be00e4
commit 7f3717bd2a
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
6 changed files with 8 additions and 8 deletions

View File

@ -282,8 +282,8 @@ func invalidPluginReason(cmd *cobra.Command) string {
var usageTemplate = `Usage:
{{- if not .HasSubCommands}} {{.UseLine}}{{end}}
{{- if .HasSubCommands}} {{ .CommandPath}}{{- if .HasAvailableFlags}} [OPTIONS]{{end}} COMMAND{{end}}
{{- if not .HasSubCommands}} {{.UseLine}}{{end}}
{{- if .HasSubCommands}} {{ .CommandPath}}{{- if .HasAvailableFlags}} [OPTIONS]{{end}} COMMAND{{end}}
{{if ne .Long ""}}{{ .Long | trim }}{{ else }}{{ .Short | trim }}{{end}}

View File

@ -49,7 +49,7 @@ func TestNonexistingHelp(t *testing.T) {
// This should actually be the whole docker help
// output, so spot check instead having of a golden
// with everything in, which will change too frequently.
Out: "Usage: docker [OPTIONS] COMMAND\n\nA self-sufficient runtime for containers",
Out: "Usage: docker [OPTIONS] COMMAND\n\nA self-sufficient runtime for containers",
Err: icmd.None,
})
// Short -h should be the same, modulo the deprecation message
@ -101,7 +101,7 @@ func TestBadHelp(t *testing.T) {
// This should be literally the whole docker help
// output, so spot check instead of a golden with
// everything in which will change all the time.
Out: "Usage: docker [OPTIONS] COMMAND\n\nA self-sufficient runtime for containers",
Out: "Usage: docker [OPTIONS] COMMAND\n\nA self-sufficient runtime for containers",
Err: icmd.None,
})
// Short -h should be the same, modulo the deprecation message

View File

@ -1,4 +1,4 @@
Usage: docker helloworld goodbye
Usage: docker helloworld goodbye
Say Goodbye instead of Hello

View File

@ -1,5 +1,5 @@
Usage: docker helloworld [OPTIONS] COMMAND
Usage: docker helloworld [OPTIONS] COMMAND
A basic Hello World plugin for tests

View File

@ -1,5 +1,5 @@
Usage: docker stack deploy [OPTIONS] STACK
Usage: docker stack deploy [OPTIONS] STACK
Deploy a new stack or update an existing stack

View File

@ -1,5 +1,5 @@
Usage: docker stack deploy [OPTIONS] STACK
Usage: docker stack deploy [OPTIONS] STACK
Deploy a new stack or update an existing stack