diff options
author | baude <bbaude@redhat.com> | 2019-01-31 13:20:04 -0600 |
---|---|---|
committer | baude <bbaude@redhat.com> | 2019-02-08 10:26:43 -0600 |
commit | 25a3923b61a5ca014318e6d957f68abd03947297 (patch) | |
tree | 2ccb4a0bd9bda70c1c258dcb1b8aca8961d9ad30 /cmd/podman/utils.go | |
parent | 962850c6e0dfcee926af31fc0ad24f1f6c26f8ac (diff) | |
download | podman-25a3923b61a5ca014318e6d957f68abd03947297.tar.gz podman-25a3923b61a5ca014318e6d957f68abd03947297.tar.bz2 podman-25a3923b61a5ca014318e6d957f68abd03947297.zip |
Migrate to cobra CLI
We intend to migrate to the cobra cli from urfave/cli because the
project is more well maintained. There are also some technical reasons
as well which extend into our remote client work.
Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'cmd/podman/utils.go')
-rw-r--r-- | cmd/podman/utils.go | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/cmd/podman/utils.go b/cmd/podman/utils.go index a59535b43..744d010d5 100644 --- a/cmd/podman/utils.go +++ b/cmd/podman/utils.go @@ -6,12 +6,12 @@ import ( "os" gosignal "os/signal" + "github.com/containers/libpod/cmd/podman/cliconfig" "github.com/containers/libpod/libpod" "github.com/docker/docker/pkg/signal" "github.com/docker/docker/pkg/term" "github.com/pkg/errors" "github.com/sirupsen/logrus" - "github.com/urfave/cli" "golang.org/x/crypto/ssh/terminal" "k8s.io/client-go/tools/remotecommand" ) @@ -158,13 +158,10 @@ func (f *RawTtyFormatter) Format(entry *logrus.Entry) ([]byte, error) { return bytes, err } -func checkMutuallyExclusiveFlags(c *cli.Context) error { +func checkMutuallyExclusiveFlags(c *cliconfig.PodmanCommand) error { if err := checkAllAndLatest(c); err != nil { return err } - if err := validateFlags(c, startFlags); err != nil { - return err - } return nil } @@ -174,8 +171,8 @@ func checkMutuallyExclusiveFlags(c *cli.Context) error { // will hold all of the successful pods, and error will hold the last error. // The remaining errors will be logged. On success, pods will hold all pods and // error will be nil. -func getPodsFromContext(c *cli.Context, r *libpod.Runtime) ([]*libpod.Pod, error) { - args := c.Args() +func getPodsFromContext(c *cliconfig.PodmanCommand, r *libpod.Runtime) ([]*libpod.Pod, error) { + args := c.InputArgs var pods []*libpod.Pod var lastError error var err error @@ -209,8 +206,8 @@ func getPodsFromContext(c *cli.Context, r *libpod.Runtime) ([]*libpod.Pod, error return pods, lastError } -func getVolumesFromContext(c *cli.Context, r *libpod.Runtime) ([]*libpod.Volume, error) { - args := c.Args() +func getVolumesFromContext(c *cliconfig.PodmanCommand, r *libpod.Runtime) ([]*libpod.Volume, error) { + args := c.InputArgs var ( vols []*libpod.Volume lastError error |