From d8a18ea3ae96ab415885fc1554db168d94d64265 Mon Sep 17 00:00:00 2001 From: Kawsar Saiyeed Date: Sun, 25 Aug 2013 00:28:36 +0100 Subject: [PATCH] Display error if resource not specified Display an error message if a container resource is not supplied to 'docker cp'. Fixes error in #1661 --- commands.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/commands.go b/commands.go index b38069f075..3324d75754 100644 --- a/commands.go +++ b/commands.go @@ -1532,6 +1532,10 @@ func (cli *DockerCli) CmdCp(args ...string) error { var copyData APICopy info := strings.Split(cmd.Arg(0), ":") + if len(info) != 2 { + return fmt.Errorf("Error: Resource not specified") + } + copyData.Resource = info[1] copyData.HostPath = cmd.Arg(1)