diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-09-17 09:40:10 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-17 09:40:10 -0400 |
commit | c8d90d00c38a78c3219e5c99a43bd900f903de8b (patch) | |
tree | bd61a7afdac163f22e2e46feecc170afcf2a4d53 /cmd/podman | |
parent | d8414add00da27098267b8bd400cb5b045e8be96 (diff) | |
parent | db86ea9bcadd58197db54da7a9b7c3d5e5c52cf8 (diff) | |
download | podman-c8d90d00c38a78c3219e5c99a43bd900f903de8b.tar.gz podman-c8d90d00c38a78c3219e5c99a43bd900f903de8b.tar.bz2 podman-c8d90d00c38a78c3219e5c99a43bd900f903de8b.zip |
Merge pull request #7646 from edsantiago/version_options
podman version and --version: fix format, exit
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/root.go | 4 | ||||
-rw-r--r-- | cmd/podman/system/version.go | 5 |
2 files changed, 1 insertions, 8 deletions
diff --git a/cmd/podman/root.go b/cmd/podman/root.go index d079018a0..8def7112f 100644 --- a/cmd/podman/root.go +++ b/cmd/podman/root.go @@ -80,10 +80,6 @@ func init() { ) rootFlags(rootCmd, registry.PodmanConfig()) - - // "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() { diff --git a/cmd/podman/system/version.go b/cmd/podman/system/version.go index edc860d0e..5f39b4820 100644 --- a/cmd/podman/system/version.go +++ b/cmd/podman/system/version.go @@ -47,12 +47,9 @@ func version(cmd *cobra.Command, args []string) error { if err != nil { return err } - _, err = io.WriteString(os.Stdout, s) + _, err = io.WriteString(os.Stdout, s+"\n") return err case cmd.Flag("format").Changed: - if !strings.HasSuffix(versionFormat, "\n") { - versionFormat += "\n" - } out := formats.StdoutTemplate{Output: versions, Template: versionFormat} err := out.Out() if err != nil { |