Display error if resource not specified

Display an error message if a container resource is not supplied to
'docker cp'.

Fixes error in #1661
Upstream-commit: d8a18ea3ae96ab415885fc1554db168d94d64265
Component: engine
This commit is contained in:
Kawsar Saiyeed
2013-08-25 00:28:36 +01:00
parent 0760b26a38
commit 825653cef4

View File

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