Make docker volume behave like docker network

Before, typing `docker volume` with no args would forward to the handler
for `docker volume ls`, except the flags for the `ls` subcommand were
not supported.
Instead just print the cmd usage.

This makes the behavior of the `docker volume` subcommand behave exactly
like the `docker network` subcommand.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
Brian Goff
2015-10-07 12:22:08 -04:00
parent 0137e3eda2
commit 2feebd95d3
2 changed files with 15 additions and 9 deletions

View File

@@ -33,11 +33,12 @@ func (cli *DockerCli) CmdVolume(args ...string) error {
}
description += "\nRun 'docker volume COMMAND --help' for more information on a command"
cmd := Cli.Subcmd("volume", []string{"[COMMAND]"}, description, true)
cmd.Require(flag.Exact, 0)
cmd.ParseFlags(args, true)
cmd := Cli.Subcmd("volume", []string{"[COMMAND]"}, description, false)
return cli.CmdVolumeLs(args...)
cmd.Require(flag.Exact, 0)
err := cmd.ParseFlags(args, true)
cmd.Usage()
return err
}
// CmdVolumeLs outputs a list of Docker volumes.