summaryrefslogtreecommitdiff
path: root/cmd/podman/root.go
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2020-04-23 09:38:35 -0700
committerJhon Honce <jhonce@redhat.com>2020-04-29 09:15:24 -0700
commit6a586992c117bd34c69ca6747ac0c0f101c6ea89 (patch)
tree90156ad5bb3e484c361194d6cab1f65f0e5c3c31 /cmd/podman/root.go
parent27aa3a7837fa1c5379ff7ca1a9dcd6416b2ac685 (diff)
downloadpodman-6a586992c117bd34c69ca6747ac0c0f101c6ea89.tar.gz
podman-6a586992c117bd34c69ca6747ac0c0f101c6ea89.tar.bz2
podman-6a586992c117bd34c69ca6747ac0c0f101c6ea89.zip
V2 restore podman -v command
* Removed extra spaces and improved error message * Updated tests to use gomega matchers Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'cmd/podman/root.go')
-rw-r--r--cmd/podman/root.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/cmd/podman/root.go b/cmd/podman/root.go
index 56ca549b6..d4fa9ea5b 100644
--- a/cmd/podman/root.go
+++ b/cmd/podman/root.go
@@ -78,6 +78,10 @@ func init() {
)
rootFlags(registry.PodmanConfig(), rootCmd.PersistentFlags())
+
+ // "version" is a local flag to avoid collisions with sub-commands that use "-v"
+ var dummyVersion bool
+ rootCmd.Flags().BoolVarP(&dummyVersion, "version", "v", false, "Version of Podman")
}
func Execute() {
@@ -206,11 +210,6 @@ func rootFlags(opts *entities.PodmanConfig, flags *pflag.FlagSet) {
flags.StringVarP(&opts.Uri, "remote", "r", "", "URL to access Podman service")
flags.StringSliceVar(&opts.Identities, "identity", []string{}, "path to SSH identity file")
- // Override default --help information of `--version` global flag
- // TODO: restore -v option for version without breaking -v for volumes
- var dummyVersion bool
- flags.BoolVar(&dummyVersion, "version", false, "Version of Podman")
-
cfg := opts.Config
flags.StringVar(&cfg.Engine.CgroupManager, "cgroup-manager", cfg.Engine.CgroupManager, opts.CGroupUsage)
flags.StringVar(&opts.CpuProfile, "cpu-profile", "", "Path for the cpu profiling results")