From a9a439183da194b0039bae7f0f4d9531c4849f88 Mon Sep 17 00:00:00 2001 From: Ken Cochrane Date: Mon, 25 Mar 2013 21:33:56 -0400 Subject: [PATCH 1/2] fixed an issue with the help history command, printed twice --- commands.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/commands.go b/commands.go index a0a322afa..2b5995292 100644 --- a/commands.go +++ b/commands.go @@ -297,7 +297,10 @@ func (srv *Server) CmdRmi(stdin io.ReadCloser, stdout io.Writer, args ...string) func (srv *Server) CmdHistory(stdin io.ReadCloser, stdout io.Writer, args ...string) error { cmd := rcli.Subcmd(stdout, "history", "[OPTIONS] IMAGE", "Show the history of an image") - if cmd.Parse(args) != nil || cmd.NArg() != 1 { + if err := cmd.Parse(args); err != nil { + return nil + } + if cmd.NArg() != 1 { cmd.Usage() return nil } From c9d93cd333b7f14782f3abbc53c7dd09fd5880dd Mon Sep 17 00:00:00 2001 From: Ken Cochrane Date: Mon, 25 Mar 2013 21:35:31 -0400 Subject: [PATCH 2/2] fixed issue with rmi help showing help twice --- commands.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/commands.go b/commands.go index 2b5995292..483d11318 100644 --- a/commands.go +++ b/commands.go @@ -283,7 +283,10 @@ func (srv *Server) CmdPort(stdin io.ReadCloser, stdout io.Writer, args ...string // 'docker rmi NAME' removes all images with the name NAME func (srv *Server) CmdRmi(stdin io.ReadCloser, stdout io.Writer, args ...string) (err error) { cmd := rcli.Subcmd(stdout, "rmimage", "[OPTIONS] IMAGE", "Remove an image") - if cmd.Parse(args) != nil || cmd.NArg() < 1 { + if err := cmd.Parse(args); err != nil { + return nil + } + if cmd.NArg() < 1 { cmd.Usage() return nil }