diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-01-22 15:28:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-22 15:28:19 +0100 |
commit | 7838a13b61ee893a6dad5cf4cc4e36c5ab74b855 (patch) | |
tree | 84f0df8442d5fd412c9b2838260e9d5cc16c989b /cmd/podman/version.go | |
parent | ec969875fa13e90f4ce696e9d24b86a02f79f54a (diff) | |
parent | 5c8e7ed0dee117c9d423849f09f82d15957893a8 (diff) | |
download | podman-7838a13b61ee893a6dad5cf4cc4e36c5ab74b855.tar.gz podman-7838a13b61ee893a6dad5cf4cc4e36c5ab74b855.tar.bz2 podman-7838a13b61ee893a6dad5cf4cc4e36c5ab74b855.zip |
Merge pull request #2199 from baude/remoteversion
enable podman-remote version
Diffstat (limited to 'cmd/podman/version.go')
-rw-r--r-- | cmd/podman/version.go | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/cmd/podman/version.go b/cmd/podman/version.go index d81deb696..fd7f06b7c 100644 --- a/cmd/podman/version.go +++ b/cmd/podman/version.go @@ -2,6 +2,8 @@ package main import ( "fmt" + "os" + "text/tabwriter" "time" "github.com/containers/libpod/cmd/podman/formats" @@ -26,20 +28,22 @@ func versionCmd(c *cli.Context) error { default: out = formats.StdoutTemplate{Output: output, Template: versionOutputFormat} } - formats.Writer(out).Out() - return nil + return formats.Writer(out).Out() } - fmt.Println("Version: ", output.Version) - fmt.Println("Go Version: ", output.GoVersion) + w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0) + defer w.Flush() + fmt.Fprintf(w, "Version:\t%s\n", output.Version) + fmt.Fprintf(w, "RemoteAPI Version:\t%d\n", output.RemoteAPIVersion) + fmt.Fprintf(w, "Go Version:\t%s\n", output.GoVersion) if output.GitCommit != "" { - fmt.Println("Git Commit: ", output.GitCommit) + fmt.Fprintf(w, "Git Commit:\t%s\n", output.GitCommit) } // Prints out the build time in readable format if output.Built != 0 { - fmt.Println("Built: ", time.Unix(output.Built, 0).Format(time.ANSIC)) + fmt.Fprintf(w, "Built:\t%s\n", time.Unix(output.Built, 0).Format(time.ANSIC)) } - fmt.Println("OS/Arch: ", output.OsArch) + fmt.Fprintf(w, "OS/Arch:\t%s\n", output.OsArch) return nil } |