1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Fixed error reporting

Removed redundant print line and fixed handling of command-less docker
invocation.

Signed-off-by: Michal Minar <miminar@redhat.com>
This commit is contained in:
Michal Minar 2014-11-19 09:42:10 +01:00
parent 1d09fc22ca
commit 08f0f1ee1d
2 changed files with 2 additions and 3 deletions

View file

@ -63,7 +63,6 @@ func (cli *DockerCli) CmdHelp(args ...string) error {
if len(args) > 0 { if len(args) > 0 {
method, exists := cli.getMethod(args[0]) method, exists := cli.getMethod(args[0])
if !exists { if !exists {
fmt.Fprintf(cli.err, "Error: Command not found: %s\n", args[0])
fmt.Fprintf(cli.err, "docker: '%s' is not a docker command. See 'docker --help'.\n", args[0]) fmt.Fprintf(cli.err, "docker: '%s' is not a docker command. See 'docker --help'.\n", args[0])
os.Exit(1) os.Exit(1)
} else { } else {

View file

@ -26,9 +26,9 @@ func ParseFlags(cmd *flag.FlagSet, args []string, withHelp bool) error {
if str := cmd.CheckArgs(); str != "" { if str := cmd.CheckArgs(); str != "" {
if withHelp { if withHelp {
if os.Args[0] == cmd.Name() { if os.Args[0] == cmd.Name() {
str += ". See '" + os.Args[0] + " " + cmd.Name() + " --help'"
} else {
str += ". See '" + os.Args[0] + " --help'" str += ". See '" + os.Args[0] + " --help'"
} else {
str += ". See '" + os.Args[0] + " " + cmd.Name() + " --help'"
} }
} }
fmt.Fprintf(cmd.Out(), "docker: %s.\n", str) fmt.Fprintf(cmd.Out(), "docker: %s.\n", str)