diff options
author | Sujil02 <sushah@redhat.com> | 2020-05-06 14:39:58 -0400 |
---|---|---|
committer | Sujil02 <sushah@redhat.com> | 2020-05-06 16:06:41 -0400 |
commit | 2080421cad535947bbc2f70693fe9fec43ae874d (patch) | |
tree | d807c8e0b66b9f594e59328313ca120a4025fb3d /cmd/podman/parse | |
parent | 062c7b8a9411b7d115f85c2df58aeea760b001bc (diff) | |
download | podman-2080421cad535947bbc2f70693fe9fec43ae874d.tar.gz podman-2080421cad535947bbc2f70693fe9fec43ae874d.tar.bz2 podman-2080421cad535947bbc2f70693fe9fec43ae874d.zip |
Enables port test
Adds port subcommand for containers
Updates check for no args when all flag is set.
Signed-off-by: Sujil02 <sushah@redhat.com>
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 { |