diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-02-22 22:10:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-22 22:10:07 +0100 |
commit | 84b3f2a7f622636e622416403d1f2642edbbd117 (patch) | |
tree | 56abfe745ffb65c6fbb75824807345c217d684f8 /cmd/podman/utils.go | |
parent | c757cb23ca15634077a8b9fa33aba7abd1c8249b (diff) | |
parent | 6ab6e2c3073d47755d441ee8c1bce90e34082e99 (diff) | |
download | podman-84b3f2a7f622636e622416403d1f2642edbbd117.tar.gz podman-84b3f2a7f622636e622416403d1f2642edbbd117.tar.bz2 podman-84b3f2a7f622636e622416403d1f2642edbbd117.zip |
Merge pull request #2386 from baude/cobravalidation
Improve command line validation
Diffstat (limited to 'cmd/podman/utils.go')
-rw-r--r-- | cmd/podman/utils.go | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/cmd/podman/utils.go b/cmd/podman/utils.go index c76e7f2a4..0fbea417b 100644 --- a/cmd/podman/utils.go +++ b/cmd/podman/utils.go @@ -3,6 +3,7 @@ package main import ( "context" "fmt" + "github.com/spf13/pflag" "os" gosignal "os/signal" @@ -158,13 +159,6 @@ func (f *RawTtyFormatter) Format(entry *logrus.Entry) ([]byte, error) { return bytes, err } -func checkMutuallyExclusiveFlags(c *cliconfig.PodmanCommand) error { - if err := checkAllAndLatest(c); err != nil { - return err - } - return nil -} - // For pod commands that have a latest and all flag, getPodsFromContext gets // pods the user specifies. If there's an error before getting pods, the pods slice // will be empty and error will be not nil. If an error occured after, the pod slice @@ -251,3 +245,11 @@ func printParallelOutput(m map[string]error, errCount int) error { } return lastError } + +// markFlagHiddenForRemoteClient makes the flag not appear as part of the CLI +// on the remote-client +func markFlagHiddenForRemoteClient(flagName string, flags *pflag.FlagSet) { + if remoteclient { + flags.MarkHidden(flagName) + } +} |