Browse Source

Merged version option by @kencochrane

Solomon Hykes 12 years ago
parent
commit
070bc0bb6d
1 changed files with 7 additions and 0 deletions
  1. 7 0
      server/server.go

+ 7 - 0
server/server.go

@@ -69,6 +69,7 @@ func (srv *Server) Help() string {
 		{"stop", "Stop a running container"},
 		{"tar", "Stream the contents of a container as a tar archive"},
 		{"umount", "(debug only) Mount a container's filesystem"},
+		{"version", "Show the docker version information"},
 		{"wait", "Block until a container stops, then print its exit code"},
 		{"web", "A web UI for docker"},
 		{"write", "Write the contents of standard input to a container's file"},
@@ -98,6 +99,12 @@ func (srv *Server) CmdWait(stdin io.ReadCloser, stdout io.Writer, args ...string
 	return nil
 }
 
+// 'docker version': show version information
+func (srv *Server) CmdVersion(stdin io.ReadCloser, stdout io.Writer, args ...string) error {
+	fmt.Fprintf(stdout, "Version:%s\n", VERSION)
+	return nil
+}
+
 // 'docker info': display system-wide information.
 func (srv *Server) CmdInfo(stdin io.ReadCloser, stdout io.Writer, args ...string) error {
 	images, _ := srv.images.Images()