1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #1587 from dotcloud/1559_improve_version

Improve version
This commit is contained in:
Guillaume J. Charmes 2013-08-22 17:28:18 -07:00
commit 78a71b1273

View file

@ -19,6 +19,7 @@ import (
"os/signal" "os/signal"
"path/filepath" "path/filepath"
"reflect" "reflect"
"runtime"
"strconv" "strconv"
"strings" "strings"
"syscall" "syscall"
@ -434,6 +435,12 @@ func (cli *DockerCli) CmdVersion(args ...string) error {
return nil 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) body, _, err := cli.call("GET", "/version", nil)
if err != nil { if err != nil {
return err return err
@ -445,13 +452,12 @@ func (cli *DockerCli) CmdVersion(args ...string) error {
utils.Debugf("Error unmarshal: body: %s, err: %s\n", body, err) utils.Debugf("Error unmarshal: body: %s, err: %s\n", body, err)
return err return err
} }
fmt.Fprintf(cli.out, "Client version: %s\n", VERSION)
fmt.Fprintf(cli.out, "Server version: %s\n", out.Version) fmt.Fprintf(cli.out, "Server version: %s\n", out.Version)
if out.GitCommit != "" { if out.GitCommit != "" {
fmt.Fprintf(cli.out, "Git commit: %s\n", out.GitCommit) fmt.Fprintf(cli.out, "Git commit (server): %s\n", out.GitCommit)
} }
if out.GoVersion != "" { 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() release := utils.GetReleaseVersion()