diff options
author | Matthew Heon <matthew.heon@gmail.com> | 2018-07-20 13:50:54 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-20 13:50:54 -0400 |
commit | 72c82fb79e0a903bc02db989d4c9b6d6f6979b17 (patch) | |
tree | 37f8908d4ac98c241f3bc20cdc16501f784fe21e /cmd/podman/utils.go | |
parent | 1bb6e5f0d8d8f4b21b4468c554e0fcba12e3607d (diff) | |
parent | 17f257140eaecbe39f679d27df85573eb15a7d51 (diff) | |
download | podman-72c82fb79e0a903bc02db989d4c9b6d6f6979b17.tar.gz podman-72c82fb79e0a903bc02db989d4c9b6d6f6979b17.tar.bz2 podman-72c82fb79e0a903bc02db989d4c9b6d6f6979b17.zip |
Merge pull request #1117 from haircommander/pod-start-stop1
Add pod start and stop
Diffstat (limited to 'cmd/podman/utils.go')
-rw-r--r-- | cmd/podman/utils.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/cmd/podman/utils.go b/cmd/podman/utils.go index 21bc1ae74..9d9e760d6 100644 --- a/cmd/podman/utils.go +++ b/cmd/podman/utils.go @@ -11,6 +11,7 @@ import ( "github.com/pkg/errors" "github.com/projectatomic/libpod/libpod" "github.com/sirupsen/logrus" + "github.com/urfave/cli" "golang.org/x/crypto/ssh/terminal" "k8s.io/client-go/tools/remotecommand" ) @@ -156,3 +157,20 @@ func (f *RawTtyFormatter) Format(entry *logrus.Entry) ([]byte, error) { return bytes, err } + +func checkMutuallyExclusiveFlags(c *cli.Context) error { + argLen := len(c.Args()) + if (c.Bool("all") || c.Bool("latest")) && argLen > 0 { + return errors.Errorf("no arguments are needed with --all or --latest") + } + if c.Bool("all") && c.Bool("latest") { + return errors.Errorf("--all and --latest cannot be used together") + } + if argLen < 1 && !c.Bool("all") && !c.Bool("latest") { + return errors.Errorf("you must provide at least one pod name or id") + } + if err := validateFlags(c, startFlags); err != nil { + return err + } + return nil +} |