1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #12870 from coolljt0725/fix_rename_help

Fix docker rename help not consistent with other commands
This commit is contained in:
Brian Goff 2015-04-29 09:14:03 -04:00
commit f2f8e4c5c9

View file

@ -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)