diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-03-19 18:19:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-19 18:19:43 +0100 |
commit | 093d9ef67341f474078bff1cba713caa0b10a692 (patch) | |
tree | bf5409bc6bc6ceeeb496ef7d7a140f2f24486835 /cmd/podmanV2/root.go | |
parent | b43e249b1d9a8d63335e7c3ac88d6ac68b21e366 (diff) | |
parent | fbe743501e2a3ea28fe446754b9b12988b4e7a0e (diff) | |
download | podman-093d9ef67341f474078bff1cba713caa0b10a692.tar.gz podman-093d9ef67341f474078bff1cba713caa0b10a692.tar.bz2 podman-093d9ef67341f474078bff1cba713caa0b10a692.zip |
Merge pull request #5546 from jwhonce/wip/entities
V2 podman command
Diffstat (limited to 'cmd/podmanV2/root.go')
-rw-r--r-- | cmd/podmanV2/root.go | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/cmd/podmanV2/root.go b/cmd/podmanV2/root.go new file mode 100644 index 000000000..778184f28 --- /dev/null +++ b/cmd/podmanV2/root.go @@ -0,0 +1,35 @@ +package main + +import ( + "fmt" + "os" + "path" + + "github.com/containers/libpod/cmd/podmanV2/registry" + "github.com/containers/libpod/version" + "github.com/spf13/cobra" +) + +var rootCmd = &cobra.Command{ + Use: path.Base(os.Args[0]), + Long: "Manage pods, containers and images", + SilenceUsage: true, + SilenceErrors: true, + TraverseChildren: true, + RunE: registry.SubCommandExists, + Version: version.Version, +} + +func init() { + // Override default --help information of `--version` global flag} + var dummyVersion bool + rootCmd.PersistentFlags().BoolVarP(&dummyVersion, "version", "v", false, "Version of podman") + rootCmd.PersistentFlags().BoolVarP(®istry.PodmanTunnel, "remote", "r", false, "Access service via SSH tunnel") +} + +func Execute() { + if err := rootCmd.Execute(); err != nil { + fmt.Println(err) + os.Exit(1) + } +} |