Added pod start and stop

As well as added tests, man pages, and completions.
Also reformatted and refactored a couple of other small things in the other pod commands.

Signed-off-by: haircommander <pehunt@redhat.com>
This commit is contained in:
haircommander
2018-07-19 14:58:48 -04:00
parent ba1871dac0
commit 17f257140e
13 changed files with 663 additions and 36 deletions

View File

@ -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
}