mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
api/client - The code for all cli commands are in one file #11610
Signed-off-by: Joey Gibson <joey@joeygibson.com>
This commit is contained in:
parent
22dba32b4d
commit
58690c9cca
41 changed files with 3381 additions and 2938 deletions
32
api/client/help.go
Normal file
32
api/client/help.go
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
package client
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
flag "github.com/docker/docker/pkg/mflag"
|
||||
)
|
||||
|
||||
func (cli *DockerCli) CmdHelp(args ...string) error {
|
||||
if len(args) > 1 {
|
||||
method, exists := cli.getMethod(args[:2]...)
|
||||
if exists {
|
||||
method("--help")
|
||||
return nil
|
||||
}
|
||||
}
|
||||
if len(args) > 0 {
|
||||
method, exists := cli.getMethod(args[0])
|
||||
if !exists {
|
||||
fmt.Fprintf(cli.err, "docker: '%s' is not a docker command. See 'docker --help'.\n", args[0])
|
||||
os.Exit(1)
|
||||
} else {
|
||||
method("--help")
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
flag.Usage()
|
||||
|
||||
return nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue