From 646afab28d8ccadf81e1d18055335739b6b983d1 Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Mon, 19 Aug 2013 12:05:47 +0000 Subject: [PATCH 1/2] improve version --- commands.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/commands.go b/commands.go index 899a8e2f1a..9d0b0968d1 100644 --- a/commands.go +++ b/commands.go @@ -19,6 +19,7 @@ import ( "os/signal" "path/filepath" "reflect" + "runtime" "strconv" "strings" "syscall" @@ -433,6 +434,12 @@ func (cli *DockerCli) CmdVersion(args ...string) error { return nil } + fmt.Fprintf(cli.out, "Client version: %s\n", VERSION) + fmt.Fprintf(cli.out, "Go version (client): %s\n", runtime.Version()) + if GITCOMMIT != "" { + fmt.Fprintf(cli.out, "Git commit (client): %s\n", GITCOMMIT) + } + body, _, err := cli.call("GET", "/version", nil) if err != nil { return err @@ -444,13 +451,12 @@ func (cli *DockerCli) CmdVersion(args ...string) error { utils.Debugf("Error unmarshal: body: %s, err: %s\n", body, err) return err } - fmt.Fprintf(cli.out, "Client version: %s\n", VERSION) fmt.Fprintf(cli.out, "Server version: %s\n", out.Version) if out.GitCommit != "" { - fmt.Fprintf(cli.out, "Git commit: %s\n", out.GitCommit) + fmt.Fprintf(cli.out, "Git commit (version): %s\n", out.GitCommit) } if out.GoVersion != "" { - fmt.Fprintf(cli.out, "Go version: %s\n", out.GoVersion) + fmt.Fprintf(cli.out, "Go version (server): %s\n", out.GoVersion) } release := utils.GetReleaseVersion() From 41973d41e950249cd630f193a4d9250e3b3740e5 Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Tue, 20 Aug 2013 11:52:37 +0000 Subject: [PATCH 2/2] fix typo --- commands.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands.go b/commands.go index 9d0b0968d1..8f31b24f7e 100644 --- a/commands.go +++ b/commands.go @@ -453,7 +453,7 @@ func (cli *DockerCli) CmdVersion(args ...string) error { } fmt.Fprintf(cli.out, "Server version: %s\n", out.Version) if out.GitCommit != "" { - fmt.Fprintf(cli.out, "Git commit (version): %s\n", out.GitCommit) + fmt.Fprintf(cli.out, "Git commit (server): %s\n", out.GitCommit) } if out.GoVersion != "" { fmt.Fprintf(cli.out, "Go version (server): %s\n", out.GoVersion)