diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-06-11 21:21:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-11 21:21:33 +0200 |
commit | c385f33cdf5e480b4c3f03227989cd56563d9cc0 (patch) | |
tree | b9aebcba7b70902b88babbcc34ba6ee37849c701 /cmd | |
parent | 130f6cba8c3cf78948c80930fa81f476cd32cc3b (diff) | |
parent | 9f49c1af46f9272c25db44c6e3e6ff9ec96aad4c (diff) | |
download | podman-c385f33cdf5e480b4c3f03227989cd56563d9cc0.tar.gz podman-c385f33cdf5e480b4c3f03227989cd56563d9cc0.tar.bz2 podman-c385f33cdf5e480b4c3f03227989cd56563d9cc0.zip |
Merge pull request #3290 from edsantiago/bats
BATS tests - get working again
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/restore.go | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/cmd/podman/restore.go b/cmd/podman/restore.go index 9c77d4a5e..6e445e5df 100644 --- a/cmd/podman/restore.go +++ b/cmd/podman/restore.go @@ -76,8 +76,22 @@ func restoreCmd(c *cliconfig.RestoreValues, cmd *cobra.Command) error { return errors.Errorf("--tcp-established cannot be used with --name") } - if (c.Import != "") && (c.All || c.Latest) { - return errors.Errorf("Cannot use --import and --all or --latest at the same time") + argLen := len(c.InputArgs) + if c.Import != "" { + if c.All || c.Latest { + return errors.Errorf("Cannot use --import with --all or --latest") + } + if argLen > 0 { + return errors.Errorf("Cannot use --import with positional arguments") + } } + + if (c.All || c.Latest) && argLen > 0 { + return errors.Errorf("no arguments are needed with --all or --latest") + } + if argLen < 1 && !c.All && !c.Latest && c.Import == "" { + return errors.Errorf("you must provide at least one name or id") + } + return runtime.Restore(getContext(), c, options) } |