From 0e752adf550ef4891e40889ea92e12ec3d775a00 Mon Sep 17 00:00:00 2001 From: Lei Jitang Date: Wed, 29 Apr 2015 19:37:20 +0800 Subject: [PATCH] Fix docker rename help not consistent with other commands Signed-off-by: Lei Jitang --- api/client/rename.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/api/client/rename.go b/api/client/rename.go index 278f471f23..ebe16963dd 100644 --- a/api/client/rename.go +++ b/api/client/rename.go @@ -1,20 +1,19 @@ package client -import "fmt" +import ( + "fmt" + + flag "github.com/docker/docker/pkg/mflag" +) // CmdRename renames a container. // // Usage: docker rename OLD_NAME NEW_NAME func (cli *DockerCli) CmdRename(args ...string) error { cmd := cli.Subcmd("rename", "OLD_NAME NEW_NAME", "Rename a container", true) - if err := cmd.Parse(args); err != nil { - return nil - } + cmd.Require(flag.Exact, 2) + cmd.ParseFlags(args, true) - if cmd.NArg() != 2 { - cmd.Usage() - return nil - } oldName := cmd.Arg(0) newName := cmd.Arg(1)