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:
parent
1d09fc22ca
commit
08f0f1ee1d
2 changed files with 2 additions and 3 deletions
|
@ -63,7 +63,6 @@ func (cli *DockerCli) CmdHelp(args ...string) error {
|
|||
if len(args) > 0 {
|
||||
method, exists := cli.getMethod(args[0])
|
||||
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])
|
||||
os.Exit(1)
|
||||
} else {
|
||||
|
|
|
@ -26,9 +26,9 @@ func ParseFlags(cmd *flag.FlagSet, args []string, withHelp bool) error {
|
|||
if str := cmd.CheckArgs(); str != "" {
|
||||
if withHelp {
|
||||
if os.Args[0] == cmd.Name() {
|
||||
str += ". See '" + os.Args[0] + " " + cmd.Name() + " --help'"
|
||||
} else {
|
||||
str += ". See '" + os.Args[0] + " --help'"
|
||||
} else {
|
||||
str += ". See '" + os.Args[0] + " " + cmd.Name() + " --help'"
|
||||
}
|
||||
}
|
||||
fmt.Fprintf(cmd.Out(), "docker: %s.\n", str)
|
||||
|
|
Loading…
Reference in a new issue