Hide [flags] in usage output
This patch hides the [flags] in the usage output of commands, using the new `.DisableFlagsInUseLine` option, instead of the temporary workaround added in8e600e10f7Before this change: docker run "docker run" requires at least 1 argument. See 'docker run --help'. Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...] [flags] Run a command in a new container After this change: docker run "docker run" requires at least 1 argument. See 'docker run --help'. Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...] Run a command in a new container Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit:00d080269aComponent: cli
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/docker/cli/cli"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/pflag"
|
||||
yaml "gopkg.in/yaml.v2"
|
||||
@@ -96,7 +95,7 @@ func GenYamlCustom(cmd *cobra.Command, w io.Writer) error {
|
||||
}
|
||||
|
||||
if cmd.Runnable() {
|
||||
cliDoc.Usage = cli.UseLine(cmd)
|
||||
cliDoc.Usage = cmd.UseLine()
|
||||
}
|
||||
|
||||
if len(cmd.Example) > 0 {
|
||||
|
||||
Reference in New Issue
Block a user