mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Add all commands to the output of 'dotcloud help'. Fixes #39
This commit is contained in:
parent
a7cb3cb86a
commit
52b811f50a
1 changed files with 36 additions and 18 deletions
|
@ -37,30 +37,40 @@ func (srv *Server) Name() string {
|
||||||
return "docker"
|
return "docker"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME: Stop violating DRY by repeating usage here and in Subcmd declarations
|
||||||
func (srv *Server) Help() string {
|
func (srv *Server) Help() string {
|
||||||
help := "Usage: docker COMMAND [arg...]\n\nA self-sufficient runtime for linux containers.\n\nCommands:\n"
|
help := "Usage: docker COMMAND [arg...]\n\nA self-sufficient runtime for linux containers.\n\nCommands:\n"
|
||||||
for _, cmd := range [][]interface{}{
|
for _, cmd := range [][]interface{}{
|
||||||
{"run", "Run a command in a container"},
|
{"attach", "Attach to a running container"},
|
||||||
{"ps", "Display a list of containers"},
|
{"cat", "Write the contents of a container's file to standard output"},
|
||||||
{"pull", "Download a tarball and create a container from it"},
|
{"commit", "Create a new image from a container's changes"},
|
||||||
{"put", "Upload a tarball and create a container from it"},
|
{"cp", "Create a copy of IMAGE and call it NAME"},
|
||||||
{"port", "Lookup the public-facing port which is NAT-ed to PRIVATE_PORT"},
|
{"debug", "(debug only) (No documentation available)"},
|
||||||
{"rm", "Remove containers"},
|
|
||||||
{"kill", "Kill a running container"},
|
|
||||||
{"wait", "Wait for the state of a container to change"},
|
|
||||||
{"stop", "Stop a running container"},
|
|
||||||
{"start", "Start a stopped container"},
|
|
||||||
{"restart", "Restart a running container"},
|
|
||||||
{"logs", "Fetch the logs of a container"},
|
|
||||||
{"diff", "Inspect changes on a container's filesystem"},
|
{"diff", "Inspect changes on a container's filesystem"},
|
||||||
{"commit", "Save the state of a container"},
|
|
||||||
{"attach", "Attach to the standard inputs and outputs of a running container"},
|
|
||||||
{"wait", "Block until a container exits, then print its exit code"},
|
|
||||||
{"info", "Display system-wide information"},
|
|
||||||
{"tar", "Stream the contents of a container as a tar archive"},
|
|
||||||
{"web", "Generate a web UI"},
|
|
||||||
{"images", "List images"},
|
{"images", "List images"},
|
||||||
|
{"info", "Display system-wide information"},
|
||||||
{"inspect", "Return low-level information on a container"},
|
{"inspect", "Return low-level information on a container"},
|
||||||
|
{"kill", "Kill a running container"},
|
||||||
|
{"layers", "(debug only) List filesystem layers"},
|
||||||
|
{"logs", "Fetch the logs of a container"},
|
||||||
|
{"ls", "List the contents of a container's directory"},
|
||||||
|
{"mirror", "(debug only) (No documentation available)"},
|
||||||
|
{"port", "Lookup the public-facing port which is NAT-ed to PRIVATE_PORT"},
|
||||||
|
{"ps", "List containers"},
|
||||||
|
{"pull", "Download a new image from a remote location"},
|
||||||
|
{"put", "Import a new image from a local archive"},
|
||||||
|
{"reset", "Reset changes to a container's filesystem"},
|
||||||
|
{"restart", "Restart a running container"},
|
||||||
|
{"rm", "Remove a container"},
|
||||||
|
{"rmimage", "Remove an image"},
|
||||||
|
{"run", "Run a command in a new container"},
|
||||||
|
{"start", "Start a stopped container"},
|
||||||
|
{"stop", "Stop a running container"},
|
||||||
|
{"tar", "Stream the contents of a container as a tar archive"},
|
||||||
|
{"umount", "(debug only) Mount a container's filesystem"},
|
||||||
|
{"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"},
|
||||||
} {
|
} {
|
||||||
help += fmt.Sprintf(" %-10.10s%s\n", cmd...)
|
help += fmt.Sprintf(" %-10.10s%s\n", cmd...)
|
||||||
}
|
}
|
||||||
|
@ -89,6 +99,14 @@ func (srv *Server) CmdWait(stdin io.ReadCloser, stdout io.Writer, args ...string
|
||||||
|
|
||||||
// 'docker info': display system-wide information.
|
// 'docker info': display system-wide information.
|
||||||
func (srv *Server) CmdInfo(stdin io.ReadCloser, stdout io.Writer, args ...string) error {
|
func (srv *Server) CmdInfo(stdin io.ReadCloser, stdout io.Writer, args ...string) error {
|
||||||
|
cmd := rcli.Subcmd(stdout, "info", "", "Display system-wide information.")
|
||||||
|
if err := cmd.Parse(args); err != nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if cmd.NArg() > 1 {
|
||||||
|
cmd.Usage()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
fmt.Fprintf(stdout, "containers: %d\nversion: %s\nimages: %d\n",
|
fmt.Fprintf(stdout, "containers: %d\nversion: %s\nimages: %d\n",
|
||||||
len(srv.containers.List()),
|
len(srv.containers.List()),
|
||||||
VERSION,
|
VERSION,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue