mirror of https://github.com/docker/cli.git
Support running 'docker help daemon'
Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
parent
aee3578520
commit
90e5326097
|
@ -11,8 +11,14 @@ import (
|
||||||
|
|
||||||
// CmdDaemon execs dockerd with the same flags
|
// CmdDaemon execs dockerd with the same flags
|
||||||
func (p DaemonProxy) CmdDaemon(args ...string) error {
|
func (p DaemonProxy) CmdDaemon(args ...string) error {
|
||||||
// Use os.Args[1:] so that "global" args are passed to dockerd
|
// Special case for handling `docker help daemon`. When pkg/mflag is removed
|
||||||
args = stripDaemonArg(os.Args[1:])
|
// we can support this on the daemon side, but that is not possible with
|
||||||
|
// pkg/mflag because it uses os.Exit(1) instead of returning an error on
|
||||||
|
// unexpected args.
|
||||||
|
if len(args) == 0 || args[0] != "--help" {
|
||||||
|
// Use os.Args[1:] so that "global" args are passed to dockerd
|
||||||
|
args = stripDaemonArg(os.Args[1:])
|
||||||
|
}
|
||||||
|
|
||||||
binaryPath, err := findDaemonBinary()
|
binaryPath, err := findDaemonBinary()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue