From 4d55877e278ea62b98927c6b9fb23b4b935431c1 Mon Sep 17 00:00:00 2001 From: Lei Jitang Date: Wed, 23 Sep 2015 05:17:03 -0400 Subject: [PATCH] Clean up: show usage when global --help present Signed-off-by: Lei Jitang --- docker/daemon.go | 6 ------ docker/docker.go | 8 ++++---- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/docker/daemon.go b/docker/daemon.go index dee31a7dbd..bd31447c64 100644 --- a/docker/daemon.go +++ b/docker/daemon.go @@ -56,12 +56,6 @@ func handleGlobalDaemonFlag() { } if *flDaemon { - if *flHelp { - // We do not show the help output here, instead, we tell the user about the new daemon command, - // because the help output is so long they would not see the warning anyway. - fmt.Fprintln(os.Stderr, "Please use 'docker daemon --help' instead.") - os.Exit(0) - } daemonCli.(*DaemonCli).CmdDaemon(flag.Args()...) os.Exit(0) } diff --git a/docker/docker.go b/docker/docker.go index 8ad0d13c05..f727fb1f69 100644 --- a/docker/docker.go +++ b/docker/docker.go @@ -50,10 +50,6 @@ func main() { return } - clientCli := client.NewDockerCli(stdin, stdout, stderr, clientFlags) - // TODO: remove once `-d` is retired - handleGlobalDaemonFlag() - if *flHelp { // if global flag --help is present, regardless of what other options and commands there are, // just print the usage. @@ -61,6 +57,10 @@ func main() { return } + // TODO: remove once `-d` is retired + handleGlobalDaemonFlag() + clientCli := client.NewDockerCli(stdin, stdout, stderr, clientFlags) + c := cli.New(clientCli, daemonCli) if err := c.Run(flag.Args()...); err != nil { if sterr, ok := err.(cli.StatusError); ok {