summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/restore.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/cmd/podman/restore.go b/cmd/podman/restore.go
index 9c77d4a5e..4d715ad4f 100644
--- a/cmd/podman/restore.go
+++ b/cmd/podman/restore.go
@@ -79,5 +79,14 @@ func restoreCmd(c *cliconfig.RestoreValues, cmd *cobra.Command) error {
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.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)
}