mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Display error if resource not specified
Display an error message if a container resource is not supplied to 'docker cp'. Fixes error in #1661
This commit is contained in:
parent
c864647721
commit
d8a18ea3ae
1 changed files with 4 additions and 0 deletions
|
@ -1532,6 +1532,10 @@ func (cli *DockerCli) CmdCp(args ...string) error {
|
||||||
var copyData APICopy
|
var copyData APICopy
|
||||||
info := strings.Split(cmd.Arg(0), ":")
|
info := strings.Split(cmd.Arg(0), ":")
|
||||||
|
|
||||||
|
if len(info) != 2 {
|
||||||
|
return fmt.Errorf("Error: Resource not specified")
|
||||||
|
}
|
||||||
|
|
||||||
copyData.Resource = info[1]
|
copyData.Resource = info[1]
|
||||||
copyData.HostPath = cmd.Arg(1)
|
copyData.HostPath = cmd.Arg(1)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue