mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #16517 from coolljt0725/show_help_all_the_time
Clean up: show usage when global --help present
This commit is contained in:
commit
01670bec48
2 changed files with 4 additions and 10 deletions
|
@ -56,12 +56,6 @@ func handleGlobalDaemonFlag() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if *flDaemon {
|
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()...)
|
daemonCli.(*DaemonCli).CmdDaemon(flag.Args()...)
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,10 +50,6 @@ func main() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
clientCli := client.NewDockerCli(stdin, stdout, stderr, clientFlags)
|
|
||||||
// TODO: remove once `-d` is retired
|
|
||||||
handleGlobalDaemonFlag()
|
|
||||||
|
|
||||||
if *flHelp {
|
if *flHelp {
|
||||||
// if global flag --help is present, regardless of what other options and commands there are,
|
// if global flag --help is present, regardless of what other options and commands there are,
|
||||||
// just print the usage.
|
// just print the usage.
|
||||||
|
@ -61,6 +57,10 @@ func main() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: remove once `-d` is retired
|
||||||
|
handleGlobalDaemonFlag()
|
||||||
|
clientCli := client.NewDockerCli(stdin, stdout, stderr, clientFlags)
|
||||||
|
|
||||||
c := cli.New(clientCli, daemonCli)
|
c := cli.New(clientCli, daemonCli)
|
||||||
if err := c.Run(flag.Args()...); err != nil {
|
if err := c.Run(flag.Args()...); err != nil {
|
||||||
if sterr, ok := err.(cli.StatusError); ok {
|
if sterr, ok := err.(cli.StatusError); ok {
|
||||||
|
|
Loading…
Add table
Reference in a new issue