diff options
author | Brent Baude <bbaude@redhat.com> | 2020-03-19 16:50:15 -0500 |
---|---|---|
committer | Brent Baude <bbaude@redhat.com> | 2020-03-20 12:54:45 -0500 |
commit | 87293028e61d0c88c258ed9f4a82c4be7f0bc896 (patch) | |
tree | cd3c6f35eed940e41afed71e7f60f7a8abac1612 /cmd/podmanV2/main.go | |
parent | ccc30c606e843d5c98e2c62a3b393a61e60976b2 (diff) | |
download | podman-87293028e61d0c88c258ed9f4a82c4be7f0bc896.tar.gz podman-87293028e61d0c88c258ed9f4a82c4be7f0bc896.tar.bz2 podman-87293028e61d0c88c258ed9f4a82c4be7f0bc896.zip |
podmanv2 container exists|wait
enable container exists and wait for podmanv2
Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'cmd/podmanV2/main.go')
-rw-r--r-- | cmd/podmanV2/main.go | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/cmd/podmanV2/main.go b/cmd/podmanV2/main.go index 0df086352..24f21d804 100644 --- a/cmd/podmanV2/main.go +++ b/cmd/podmanV2/main.go @@ -5,6 +5,7 @@ import ( "os" "reflect" "runtime" + "strings" _ "github.com/containers/libpod/cmd/podmanV2/containers" _ "github.com/containers/libpod/cmd/podmanV2/images" @@ -31,17 +32,19 @@ func initCobra() { case "darwin": fallthrough case "windows": - registry.GlobalFlags.EngineMode = entities.TunnelMode + registry.EngineOpts.EngineMode = entities.TunnelMode case "linux": - registry.GlobalFlags.EngineMode = entities.ABIMode + registry.EngineOpts.EngineMode = entities.ABIMode default: logrus.Errorf("%s is not a supported OS", runtime.GOOS) os.Exit(1) } // TODO: Is there a Cobra way to "peek" at os.Args? - if ok := Contains("--remote", os.Args); ok { - registry.GlobalFlags.EngineMode = entities.TunnelMode + for _, v := range os.Args { + if strings.HasPrefix(v, "--remote") { + registry.EngineOpts.EngineMode = entities.TunnelMode + } } cobra.OnInitialize(func() {}) @@ -50,7 +53,7 @@ func initCobra() { func main() { fmt.Fprintf(os.Stderr, "Number of commands: %d\n", len(registry.Commands)) for _, c := range registry.Commands { - if Contains(registry.GlobalFlags.EngineMode, c.Mode) { + if Contains(registry.EngineOpts.EngineMode, c.Mode) { parent := rootCmd if c.Parent != nil { parent = c.Parent |