Don't automagically add "[OPTIONS]" to usage

This removes the logic to automatically
add [OPTIONS] to the usage output.

The current logic was broken if a command
only has deprecated or hidden flags, and
in many cases put the [OPTIONS] in the
wrong location.

Requiring the usage string to be set
manually gives more predictable results,
and shouldn't require much to maintain.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 4f0b5105524649169d765bb94c2806209ab21904
Component: engine
This commit is contained in:
Sebastiaan van Stijn
2016-07-16 16:44:10 +02:00
parent 628a2430c9
commit 24235167aa
13 changed files with 14 additions and 19 deletions

View File

@ -28,7 +28,7 @@ func newListCommand(dockerCli *client.DockerCli) *cobra.Command {
opts := listOptions{filter: opts.NewFilterOpt()}
cmd := &cobra.Command{
Use: "ls",
Use: "ls [OPTIONS]",
Aliases: []string{"list"},
Short: "List nodes in the swarm",
Args: cli.NoArgs,