Fix help text being incorrect with multiple args
E.g. "docker foobar run" would have printed "Command not found: foobar" and printed the help text for "run". It should instead print the root help message for docker. Signed-off-by: Ben Firshman <ben@firshman.co.uk> Upstream-commit: ef004ec03fe5aad33da7d53f196f16382c750d07 Component: engine
This commit is contained in:
@ -75,11 +75,11 @@ func (cli *DockerCli) Cmd(args ...string) error {
|
||||
method, exists := cli.getMethod(args[0])
|
||||
if !exists {
|
||||
fmt.Println("Error: Command not found:", args[0])
|
||||
return cli.CmdHelp(args[1:]...)
|
||||
return cli.CmdHelp()
|
||||
}
|
||||
return method(args[1:]...)
|
||||
}
|
||||
return cli.CmdHelp(args...)
|
||||
return cli.CmdHelp()
|
||||
}
|
||||
|
||||
func (cli *DockerCli) Subcmd(name, signature, description string) *flag.FlagSet {
|
||||
|
||||
Reference in New Issue
Block a user