Skip to content

Commit

Permalink
Merge pull request #7646 from edsantiago/version_options
Browse files Browse the repository at this point in the history
podman version and --version: fix format, exit
  • Loading branch information
openshift-merge-robot committed Sep 17, 2020
2 parents d8414ad + db86ea9 commit c8d90d0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
4 changes: 0 additions & 4 deletions cmd/podman/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
5 changes: 1 addition & 4 deletions cmd/podman/system/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit c8d90d0

Please sign in to comment.