{"action":"created","comment":{"url":"https://api.github.com/repos/docker/docker/pulls/comments/34927992","id":34927992,"diff_hunk":"@@ -12,34 +12,71 @@ import (\n \t\"github.com/docker/docker/utils\"\n )\n \n+var VersionTemplate = `Client:\n+ Version:      {{.Client.Version}}\n+ API version:  {{.Client.ApiVersion}}\n+ Go version:   {{.Client.GoVersion}}\n+ Git commit:   {{.Client.GitCommit}}\n+ Built:        {{.Client.BuildTime}}\n+ OS/Arch:      {{.Client.Os}}/{{.Client.Arch}}{{if .Client.Experimental}}\n+ Experimental: {{.Client.Experimental}}{{end}}{{if .ServerOK}}\n+\n+Server:\n+ Version:      {{.Server.Version}}\n+ API version:  {{.Server.ApiVersion}}\n+ Go version:   {{.Server.GoVersion}}\n+ Git commit:   {{.Server.GitCommit}}\n+ Built:        {{.Server.BuildTime}}\n+ OS/Arch:      {{.Server.Os}}/{{.Server.Arch}}{{if .Server.Experimental}}\n+ Experimental: {{.Server.Experimental}}{{end}}{{end}}`\n+\n+type VersionData struct {\n+\tClient   types.Version\n+\tServerOK bool\n+\tServer   types.Version\n+}\n+\n // CmdVersion shows Docker version information.\n //\n // Available version information is shown for: client Docker version, client API version, client Go version, client Git commit, client OS/Arch, server Docker version, server API version, server Go version, server Git commit, and server OS/Arch.\n //\n // Usage: docker version\n-func (cli *DockerCli) CmdVersion(args ...string) error {\n+func (cli *DockerCli) CmdVersion(args ...string) (err error) {\n \tcmd := cli.Subcmd(\"version\", nil, \"Show the Docker version information.\", true)\n+\ttmplStr := cmd.String([]string{\"f\", \"#format\", \"-format\"}, \"\", \"Format the output using the given go template\")","path":"api/client/version.go","position":46,"original_position":46,"commit_id":"41588a57662456f1a27c48921c680ac2a6e079c3","original_commit_id":"41588a57662456f1a27c48921c680ac2a6e079c3","user":{"login":"tiborvass","id":827131,"avatar_url":"https://avatars.githubusercontent.com/u/827131?v=3","gravatar_id":"","url":"https://api.github.com/users/tiborvass","html_url":"https://github.com/tiborvass","followers_url":"https://api.github.com/users/tiborvass/followers","following_url":"https://api.github.com/users/tiborvass/following{/other_user}","gists_url":"https://api.github.com/users/tiborvass/gists{/gist_id}","starred_url":"https://api.github.com/users/tiborvass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiborvass/subscriptions","organizations_url":"https://api.github.com/users/tiborvass/orgs","repos_url":"https://api.github.com/users/tiborvass/repos","events_url":"https://api.github.com/users/tiborvass/events{/privacy}","received_events_url":"https://api.github.com/users/tiborvass/received_events","type":"User","site_admin":false},"body":"@phemmer i just noticed: you shouldn't use `#format`, that's for old flags, you are introducing a new one here.","created_at":"2015-07-17T20:29:02Z","updated_at":"2015-07-17T20:29:02Z","html_url":"https://github.com/docker/docker/pull/14194#discussion_r34927992","pull_request_url":"https://api.github.com/repos/docker/docker/pulls/14194","_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/comments/34927992"},"html":{"href":"https://github.com/docker/docker/pull/14194#discussion_r34927992"},"pull_request":{"href":"https://api.github.com/repos/docker/docker/pulls/14194"}}},"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/14194","id":38611020,"html_url":"https://github.com/docker/docker/pull/14194","diff_url":"https://github.com/docker/docker/pull/14194.diff","patch_url":"https://github.com/docker/docker/pull/14194.patch","issue_url":"https://api.github.com/repos/docker/docker/issues/14194","number":14194,"state":"closed","locked":false,"title":"add --format flag to `docker version`","user":{"login":"phemmer","id":1826947,"avatar_url":"https://avatars.githubusercontent.com/u/1826947?v=3","gravatar_id":"","url":"https://api.github.com/users/phemmer","html_url":"https://github.com/phemmer","followers_url":"https://api.github.com/users/phemmer/followers","following_url":"https://api.github.com/users/phemmer/following{/other_user}","gists_url":"https://api.github.com/users/phemmer/gists{/gist_id}","starred_url":"https://api.github.com/users/phemmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phemmer/subscriptions","organizations_url":"https://api.github.com/users/phemmer/orgs","repos_url":"https://api.github.com/users/phemmer/repos","events_url":"https://api.github.com/users/phemmer/events{/privacy}","received_events_url":"https://api.github.com/users/phemmer/received_events","type":"User","site_admin":false},"body":"This adds the `--format` flag to `docker version`.\r\n\r\nCloses #14186 \r\n\r\n**Default output:**\r\n\r\n    $ docker version\r\n\tClient:\r\n\t Version:      1.8.0\r\n\t API version:  1.20\r\n\t Go version:   go1.4.2\r\n\t Git commit:   f5bae0a\r\n\t Built:        Tue Jun 23 17:56:00 UTC 2015\r\n\t OS/Arch:      linux/amd64\r\n\r\n\tServer:\r\n\t Version:      1.8.0\r\n\t API version:  1.20\r\n\t Go version:   go1.4.2\r\n\t Git commit:   f5bae0a\r\n\t Built:        Tue Jun 23 17:56:00 UTC 2015\r\n\t OS/Arch:      linux/amd64\r\n\r\n**Get server version:**\r\n\r\n    $ docker version --format '{{.Server.Version}}'\r\n\t1.8.0\r\n\r\n**Dump raw data:**\r\n\r\n    $ docker version --format '{{json .}}'\r\n    {\"Client\":{\"Version\":\"1.8.0\",\"ApiVersion\":\"1.20\",\"GitCommit\":\"f5bae0a\",\"GoVersion\":\"go1.4.2\",\"Os\":\"linux\",\"Arch\":\"amd64\",\"BuildTime\":\"Tue Jun 23 17:56:00 UTC 2015\"},\"ServerOK\":true,\"Server\":{\"Version\":\"1.8.0\",\"ApiVersion\":\"1.20\",\"GitCommit\":\"f5bae0a\",\"GoVersion\":\"go1.4.2\",\"Os\":\"linux\",\"Arch\":\"amd64\",\"KernelVersion\":\"3.13.2-gentoo\",\"BuildTime\":\"Tue Jun 23 17:56:00 UTC 2015\"}}\r\n\r\n**Dead server:**\r\n\r\n    $ docker version\r\n    Client:\r\n     Version:      1.8.0-dev\r\n     API version:  1.20\r\n     Go version:   go1.4.1\r\n     Git commit:   2a8293f-dirty\r\n     Built:        Fri Jun 26 01:38:16 UTC 2015\r\n     OS/Arch:      linux/amd64\r\n    Get http:///var/run/docker.sock/v1.20/version: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?\r\n\r\n*(error goes to STDERR, allowing capturing STDOUT to still work if only client data is needed)*","created_at":"2015-06-26T01:54:02Z","updated_at":"2015-07-17T20:29:03Z","closed_at":"2015-07-14T00:04:06Z","merged_at":"2015-07-14T00:04:06Z","merge_commit_sha":"013f4cd42799c3b06a45e87ef4c17ab7be9ced69","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/docker/docker/pulls/14194/commits","review_comments_url":"https://api.github.com/repos/docker/docker/pulls/14194/comments","review_comment_url":"https://api.github.com/repos/docker/docker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/docker/issues/14194/comments","statuses_url":"https://api.github.com/repos/docker/docker/statuses/41588a57662456f1a27c48921c680ac2a6e079c3","head":{"label":"phemmer:cli-version-format","ref":"cli-version-format","sha":"41588a57662456f1a27c48921c680ac2a6e079c3","user":{"login":"phemmer","id":1826947,"avatar_url":"https://avatars.githubusercontent.com/u/1826947?v=3","gravatar_id":"","url":"https://api.github.com/users/phemmer","html_url":"https://github.com/phemmer","followers_url":"https://api.github.com/users/phemmer/followers","following_url":"https://api.github.com/users/phemmer/following{/other_user}","gists_url":"https://api.github.com/users/phemmer/gists{/gist_id}","starred_url":"https://api.github.com/users/phemmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phemmer/subscriptions","organizations_url":"https://api.github.com/users/phemmer/orgs","repos_url":"https://api.github.com/users/phemmer/repos","events_url":"https://api.github.com/users/phemmer/events{/privacy}","received_events_url":"https://api.github.com/users/phemmer/received_events","type":"User","site_admin":false},"repo":{"id":21368240,"name":"docker","full_name":"phemmer/docker","owner":{"login":"phemmer","id":1826947,"avatar_url":"https://avatars.githubusercontent.com/u/1826947?v=3","gravatar_id":"","url":"https://api.github.com/users/phemmer","html_url":"https://github.com/phemmer","followers_url":"https://api.github.com/users/phemmer/followers","following_url":"https://api.github.com/users/phemmer/following{/other_user}","gists_url":"https://api.github.com/users/phemmer/gists{/gist_id}","starred_url":"https://api.github.com/users/phemmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phemmer/subscriptions","organizations_url":"https://api.github.com/users/phemmer/orgs","repos_url":"https://api.github.com/users/phemmer/repos","events_url":"https://api.github.com/users/phemmer/events{/privacy}","received_events_url":"https://api.github.com/users/phemmer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/phemmer/docker","description":"Docker - the open-source application container engine","fork":true,"url":"https://api.github.com/repos/phemmer/docker","forks_url":"https://api.github.com/repos/phemmer/docker/forks","keys_url":"https://api.github.com/repos/phemmer/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phemmer/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phemmer/docker/teams","hooks_url":"https://api.github.com/repos/phemmer/docker/hooks","issue_events_url":"https://api.github.com/repos/phemmer/docker/issues/events{/number}","events_url":"https://api.github.com/repos/phemmer/docker/events","assignees_url":"https://api.github.com/repos/phemmer/docker/assignees{/user}","branches_url":"https://api.github.com/repos/phemmer/docker/branches{/branch}","tags_url":"https://api.github.com/repos/phemmer/docker/tags","blobs_url":"https://api.github.com/repos/phemmer/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phemmer/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phemmer/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/phemmer/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phemmer/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/phemmer/docker/languages","stargazers_url":"https://api.github.com/repos/phemmer/docker/stargazers","contributors_url":"https://api.github.com/repos/phemmer/docker/contributors","subscribers_url":"https://api.github.com/repos/phemmer/docker/subscribers","subscription_url":"https://api.github.com/repos/phemmer/docker/subscription","commits_url":"https://api.github.com/repos/phemmer/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/phemmer/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/phemmer/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/phemmer/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/phemmer/docker/contents/{+path}","compare_url":"https://api.github.com/repos/phemmer/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phemmer/docker/merges","archive_url":"https://api.github.com/repos/phemmer/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phemmer/docker/downloads","issues_url":"https://api.github.com/repos/phemmer/docker/issues{/number}","pulls_url":"https://api.github.com/repos/phemmer/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/phemmer/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/phemmer/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phemmer/docker/labels{/name}","releases_url":"https://api.github.com/repos/phemmer/docker/releases{/id}","created_at":"2014-06-30T22:41:52Z","updated_at":"2014-06-30T22:37:05Z","pushed_at":"2015-07-13T23:15:37Z","git_url":"git://github.com/phemmer/docker.git","ssh_url":"git@github.com:phemmer/docker.git","clone_url":"https://github.com/phemmer/docker.git","svn_url":"https://github.com/phemmer/docker","homepage":"http://www.docker.com","size":59908,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"docker:master","ref":"master","sha":"60b34cb957b224e28e6350bbebd629bec61730b5","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":7691631,"name":"docker","full_name":"docker/docker","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/docker","description":"Docker - the open-source application container engine","fork":false,"url":"https://api.github.com/repos/docker/docker","forks_url":"https://api.github.com/repos/docker/docker/forks","keys_url":"https://api.github.com/repos/docker/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/docker/teams","hooks_url":"https://api.github.com/repos/docker/docker/hooks","issue_events_url":"https://api.github.com/repos/docker/docker/issues/events{/number}","events_url":"https://api.github.com/repos/docker/docker/events","assignees_url":"https://api.github.com/repos/docker/docker/assignees{/user}","branches_url":"https://api.github.com/repos/docker/docker/branches{/branch}","tags_url":"https://api.github.com/repos/docker/docker/tags","blobs_url":"https://api.github.com/repos/docker/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/docker/languages","stargazers_url":"https://api.github.com/repos/docker/docker/stargazers","contributors_url":"https://api.github.com/repos/docker/docker/contributors","subscribers_url":"https://api.github.com/repos/docker/docker/subscribers","subscription_url":"https://api.github.com/repos/docker/docker/subscription","commits_url":"https://api.github.com/repos/docker/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/docker/contents/{+path}","compare_url":"https://api.github.com/repos/docker/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/docker/merges","archive_url":"https://api.github.com/repos/docker/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/docker/downloads","issues_url":"https://api.github.com/repos/docker/docker/issues{/number}","pulls_url":"https://api.github.com/repos/docker/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/docker/labels{/name}","releases_url":"https://api.github.com/repos/docker/docker/releases{/id}","created_at":"2013-01-18T18:10:57Z","updated_at":"2015-07-17T20:25:38Z","pushed_at":"2015-07-17T20:27:38Z","git_url":"git://github.com/docker/docker.git","ssh_url":"git@github.com:docker/docker.git","clone_url":"https://github.com/docker/docker.git","svn_url":"https://github.com/docker/docker","homepage":"http://www.docker.com","size":225923,"stargazers_count":23331,"watchers_count":23331,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5790,"mirror_url":null,"open_issues_count":1038,"forks":5790,"open_issues":1038,"watchers":23331,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/14194"},"html":{"href":"https://github.com/docker/docker/pull/14194"},"issue":{"href":"https://api.github.com/repos/docker/docker/issues/14194"},"comments":{"href":"https://api.github.com/repos/docker/docker/issues/14194/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/docker/pulls/14194/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/docker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/docker/pulls/14194/commits"},"statuses":{"href":"https://api.github.com/repos/docker/docker/statuses/41588a57662456f1a27c48921c680ac2a6e079c3"}}}}