From f38232b475d126d6ea3a37d82be2c7269324e4ab Mon Sep 17 00:00:00 2001 From: Ma Shimiao Date: Tue, 9 Jun 2015 21:33:41 +0800 Subject: [PATCH] Unify docker commands' usage in man and help Signed-off-by: Ma Shimiao --- api/client/cp.go | 2 +- api/client/export.go | 2 +- api/client/pull.go | 2 +- api/client/push.go | 2 +- docker/flags.go | 32 +++++++++++++++--------------- docs/reference/commandline/load.md | 2 +- man/docker-export.1.md | 2 +- man/docker-load.1.md | 2 +- man/docker-logout.1.md | 2 +- man/docker-top.1.md | 3 ++- 10 files changed, 26 insertions(+), 25 deletions(-) diff --git a/api/client/cp.go b/api/client/cp.go index 67ddfa483d..5cf72b9075 100644 --- a/api/client/cp.go +++ b/api/client/cp.go @@ -16,7 +16,7 @@ import ( // // Usage: docker cp CONTAINER:PATH HOSTDIR func (cli *DockerCli) CmdCp(args ...string) error { - cmd := cli.Subcmd("cp", []string{"CONTAINER:PATH HOSTDIR|-"}, "Copy files/folders from a PATH on the container to a HOSTDIR on the host\nrunning the command. Use '-' to write the data as a tar file to STDOUT.", true) + cmd := cli.Subcmd("cp", []string{"CONTAINER:PATH HOSTDIR|-"}, "Copy files/folders from a container's PATH to a HOSTDIR on the host\nrunning the command. Use '-' to write the data as a tar file to STDOUT.", true) cmd.Require(flag.Exact, 2) cmd.ParseFlags(args, true) diff --git a/api/client/export.go b/api/client/export.go index 87a8546d9a..381e555b63 100644 --- a/api/client/export.go +++ b/api/client/export.go @@ -14,7 +14,7 @@ import ( // // Usage: docker export [OPTIONS] CONTAINER func (cli *DockerCli) CmdExport(args ...string) error { - cmd := cli.Subcmd("export", []string{"CONTAINER"}, "Export a filesystem as a tar archive (streamed to STDOUT by default)", true) + cmd := cli.Subcmd("export", []string{"CONTAINER"}, "Export the contents of a container's filesystem as a tar archive", true) outfile := cmd.String([]string{"o", "-output"}, "", "Write to a file, instead of STDOUT") cmd.Require(flag.Exact, 1) diff --git a/api/client/pull.go b/api/client/pull.go index b2e064bc50..8607eac192 100644 --- a/api/client/pull.go +++ b/api/client/pull.go @@ -15,7 +15,7 @@ import ( // // Usage: docker pull [OPTIONS] IMAGENAME[:TAG|@DIGEST] func (cli *DockerCli) CmdPull(args ...string) error { - cmd := cli.Subcmd("pull", []string{"NAME[:TAG|@DIGEST]"}, "Pull an image or a repository from the registry", true) + cmd := cli.Subcmd("pull", []string{"NAME[:TAG|@DIGEST]"}, "Pull an image or a repository from a registry", true) allTags := cmd.Bool([]string{"a", "-all-tags"}, false, "Download all tagged images in the repository") cmd.Require(flag.Exact, 1) diff --git a/api/client/push.go b/api/client/push.go index 632fde3712..e0bfe82cb1 100644 --- a/api/client/push.go +++ b/api/client/push.go @@ -13,7 +13,7 @@ import ( // // Usage: docker push NAME[:TAG] func (cli *DockerCli) CmdPush(args ...string) error { - cmd := cli.Subcmd("push", []string{"NAME[:TAG]"}, "Push an image or a repository to the registry", true) + cmd := cli.Subcmd("push", []string{"NAME[:TAG]"}, "Push an image or a repository to a registry", true) cmd.Require(flag.Exact, 1) cmd.ParseFlags(args, true) diff --git a/docker/flags.go b/docker/flags.go index d860ec7e1f..969469c176 100644 --- a/docker/flags.go +++ b/docker/flags.go @@ -32,40 +32,40 @@ var ( {"attach", "Attach to a running container"}, {"build", "Build an image from a Dockerfile"}, {"commit", "Create a new image from a container's changes"}, - {"cp", "Copy files/folders from a container's filesystem to the host path"}, + {"cp", "Copy files/folders from a container to a HOSTDIR or to STDOUT"}, {"create", "Create a new container"}, {"diff", "Inspect changes on a container's filesystem"}, {"events", "Get real time events from the server"}, {"exec", "Run a command in a running container"}, - {"export", "Stream the contents of a container as a tar archive"}, + {"export", "Export a container's filesystem as a tar archive"}, {"history", "Show the history of an image"}, {"images", "List images"}, - {"import", "Create a new filesystem image from the contents of a tarball"}, + {"import", "Import the contents from a tarball to create a filesystem image"}, {"info", "Display system-wide information"}, {"inspect", "Return low-level information on a container or image"}, {"kill", "Kill a running container"}, - {"load", "Load an image from a tar archive"}, - {"login", "Register or log in to a Docker registry server"}, - {"logout", "Log out from a Docker registry server"}, + {"load", "Load an image from a tar archive or STDIN"}, + {"login", "Register or log in to a Docker registry"}, + {"logout", "Log out from a Docker registry"}, {"logs", "Fetch the logs of a container"}, - {"port", "Lookup the public-facing port that is NAT-ed to PRIVATE_PORT"}, + {"port", "List port mappings or a specific mapping for the CONTAINER"}, {"pause", "Pause all processes within a container"}, {"ps", "List containers"}, - {"pull", "Pull an image or a repository from a Docker registry server"}, - {"push", "Push an image or a repository to a Docker registry server"}, - {"rename", "Rename an existing container"}, + {"pull", "Pull an image or a repository from a registry"}, + {"push", "Push an image or a repository to a registry"}, + {"rename", "Rename a container"}, {"restart", "Restart a running container"}, {"rm", "Remove one or more containers"}, {"rmi", "Remove one or more images"}, {"run", "Run a command in a new container"}, - {"save", "Save an image to a tar archive"}, - {"search", "Search for an image on the Docker Hub"}, - {"start", "Start a stopped container"}, - {"stats", "Display a stream of a containers' resource usage statistics"}, + {"save", "Save an image(s) to a tar archive"}, + {"search", "Search the Docker Hub for images"}, + {"start", "Start one or more stopped containers"}, + {"stats", "Display a live stream of container(s) resource usage statistics"}, {"stop", "Stop a running container"}, {"tag", "Tag an image into a repository"}, - {"top", "Lookup the running processes of a container"}, - {"unpause", "Unpause a paused container"}, + {"top", "Display the running processes of a container"}, + {"unpause", "Unpause all processes within a container"}, {"version", "Show the Docker version information"}, {"wait", "Block until a container stops, then print its exit code"}, } diff --git a/docs/reference/commandline/load.md b/docs/reference/commandline/load.md index 4ffd083822..2f52465ebf 100644 --- a/docs/reference/commandline/load.md +++ b/docs/reference/commandline/load.md @@ -13,7 +13,7 @@ weight=1 Usage: docker load [OPTIONS] - Load an image from a tar archive on STDIN + Load an image from a tar archive or STDIN -i, --input="" Read from a tar archive file, instead of STDIN diff --git a/man/docker-export.1.md b/man/docker-export.1.md index 0bc71ad89f..f3096eacfc 100644 --- a/man/docker-export.1.md +++ b/man/docker-export.1.md @@ -2,7 +2,7 @@ % Docker Community % JUNE 2014 # NAME -docker-export - Export the contents of a filesystem as a tar archive to STDOUT +docker-export - Export the contents of a container's filesystem as a tar archive # SYNOPSIS **docker export** diff --git a/man/docker-load.1.md b/man/docker-load.1.md index c045443689..1a43a5e0d9 100644 --- a/man/docker-load.1.md +++ b/man/docker-load.1.md @@ -2,7 +2,7 @@ % Docker Community % JUNE 2014 # NAME -docker-load - Load an image from a tar archive on STDIN +docker-load - Load an image from a tar archive or STDIN # SYNOPSIS **docker load** diff --git a/man/docker-logout.1.md b/man/docker-logout.1.md index 3726fd66ca..d116986798 100644 --- a/man/docker-logout.1.md +++ b/man/docker-logout.1.md @@ -2,7 +2,7 @@ % Docker Community % JUNE 2014 # NAME -docker-logout - Log out from a Docker Registry. +docker-logout - Log out from a Docker registry. # SYNOPSIS **docker logout** diff --git a/man/docker-top.1.md b/man/docker-top.1.md index c3bbf883f7..9828d98be5 100644 --- a/man/docker-top.1.md +++ b/man/docker-top.1.md @@ -11,7 +11,7 @@ CONTAINER [ps OPTIONS] # DESCRIPTION -Look up the running process of the container. ps-OPTION can be any of the +Display the running process of the container. ps-OPTION can be any of the options you would pass to a Linux ps command. # OPTIONS @@ -31,3 +31,4 @@ Run **docker top** with the ps option of -x: April 2014, Originally compiled by William Henry (whenry at redhat dot com) based on docker.com source material and internal work. June 2014, updated by Sven Dowideit +June 2015, updated by Ma Shimiao