diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-05-07 10:01:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-07 10:01:22 +0200 |
commit | 7cd2e35203cd059a75792c1ff03486ba32a23ddb (patch) | |
tree | d807c8e0b66b9f594e59328313ca120a4025fb3d /cmd/podman/parse | |
parent | 062c7b8a9411b7d115f85c2df58aeea760b001bc (diff) | |
parent | 2080421cad535947bbc2f70693fe9fec43ae874d (diff) | |
download | podman-7cd2e35203cd059a75792c1ff03486ba32a23ddb.tar.gz podman-7cd2e35203cd059a75792c1ff03486ba32a23ddb.tar.bz2 podman-7cd2e35203cd059a75792c1ff03486ba32a23ddb.zip |
Merge pull request #6107 from sujil02/enableport
Enables port test
Diffstat (limited to 'cmd/podman/parse')
-rw-r--r-- | cmd/podman/parse/common.go | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/cmd/podman/parse/common.go b/cmd/podman/parse/common.go index a5e9b4fc2..13f425b6d 100644 --- a/cmd/podman/parse/common.go +++ b/cmd/podman/parse/common.go @@ -30,13 +30,20 @@ func CheckAllLatestAndCIDFile(c *cobra.Command, args []string, ignoreArgLen bool return errors.Errorf("--all and --latest cannot be used together") } + if (argLen > 0) && specifiedAll { + return errors.Errorf("no arguments are needed with --all") + } + if ignoreArgLen { return nil } - if (argLen > 0) && (specifiedAll || specifiedLatest) { - return errors.Errorf("no arguments are needed with --all or --latest") - } else if cidfile && (argLen > 0) && (specifiedAll || specifiedLatest || specifiedCIDFile) { - return errors.Errorf("no arguments are needed with --all, --latest or --cidfile") + + if argLen > 0 { + if specifiedLatest { + return errors.Errorf("no arguments are needed with --latest") + } else if cidfile && (specifiedLatest || specifiedCIDFile) { + return errors.Errorf("no arguments are needed with --latest or --cidfile") + } } if specifiedCIDFile { |