From 5c8e7ed0dee117c9d423849f09f82d15957893a8 Mon Sep 17 00:00:00 2001 From: baude Date: Mon, 21 Jan 2019 15:18:13 -0600 Subject: enable podman-remote version initial enablement of podman-remote version. includes add a APIVersion const that will allow us to check compatibility between host/client when connections are made. also added client related information to podman info. Signed-off-by: baude --- cmd/podman/version.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'cmd/podman/version.go') 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 } -- cgit v1.2.3-54-g00ecf