From 45436942afeb7354a997f12c7fb0cb1f520390ae 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 Upstream-commit: a9a439183da194b0039bae7f0f4d9531c4849f88 Component: engine --- components/engine/commands.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/engine/commands.go b/components/engine/commands.go index a0a322afab..2b59952920 100644 --- a/components/engine/commands.go +++ b/components/engine/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 2a4596d92bcc1047ea7017b24016c8920d7e0c16 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 Upstream-commit: c9d93cd333b7f14782f3abbc53c7dd09fd5880dd Component: engine --- components/engine/commands.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/engine/commands.go b/components/engine/commands.go index 2b59952920..483d113185 100644 --- a/components/engine/commands.go +++ b/components/engine/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 }