summaryrefslogtreecommitdiff
path: root/cmd/podman/version.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2019-01-21 15:18:13 -0600
committerbaude <bbaude@redhat.com>2019-01-21 15:23:30 -0600
commit5c8e7ed0dee117c9d423849f09f82d15957893a8 (patch)
treef5244f8cabf513a409a69b72f2c97d0d0e5d996c /cmd/podman/version.go
parentba3509665c16365870ae2c50c6798c0e8489cb78 (diff)
downloadpodman-5c8e7ed0dee117c9d423849f09f82d15957893a8.tar.gz
podman-5c8e7ed0dee117c9d423849f09f82d15957893a8.tar.bz2
podman-5c8e7ed0dee117c9d423849f09f82d15957893a8.zip
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 <bbaude@redhat.com>
Diffstat (limited to 'cmd/podman/version.go')
-rw-r--r--cmd/podman/version.go18
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
}