mirror of
https://github.com/containers/podman.git
synced 2025-12-06 05:37:49 +08:00
Merge pull request #3290 from edsantiago/bats
BATS tests - get working again
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user