From 48930c8bbf8ec4d6a022c1b204dd326dae9089bc Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Thu, 22 Sep 2016 14:11:08 -0400 Subject: [PATCH] Read long description from a file. Signed-off-by: Daniel Nephin --- command/volume/cmd.go | 19 ------------------- command/volume/create.go | 40 --------------------------------------- command/volume/inspect.go | 9 --------- command/volume/list.go | 17 ----------------- 4 files changed, 85 deletions(-) diff --git a/command/volume/cmd.go b/command/volume/cmd.go index 40862f29d1..2bc7687750 100644 --- a/command/volume/cmd.go +++ b/command/volume/cmd.go @@ -12,7 +12,6 @@ func NewVolumeCommand(dockerCli *command.DockerCli) *cobra.Command { cmd := &cobra.Command{ Use: "volume COMMAND", Short: "Manage volumes", - Long: volumeDescription, Args: cli.NoArgs, RunE: dockerCli.ShowHelp, } @@ -25,21 +24,3 @@ func NewVolumeCommand(dockerCli *command.DockerCli) *cobra.Command { ) return cmd } - -var volumeDescription = ` -The **docker volume** command has subcommands for managing data volumes. A data -volume is a specially-designated directory that by-passes storage driver -management. - -Data volumes persist data independent of a container's life cycle. When you -delete a container, the Docker daemon does not delete any data volumes. You can -share volumes across multiple containers. Moreover, you can share data volumes -with other computing resources in your system. - -To see help for a subcommand, use: - - docker volume COMMAND --help - -For full details on using docker volume visit Docker's online documentation. - -` diff --git a/command/volume/create.go b/command/volume/create.go index 7b2a7e3318..de45ce67e8 100644 --- a/command/volume/create.go +++ b/command/volume/create.go @@ -29,7 +29,6 @@ func newCreateCommand(dockerCli *command.DockerCli) *cobra.Command { cmd := &cobra.Command{ Use: "create [OPTIONS] [VOLUME]", Short: "Create a volume", - Long: createDescription, Args: cli.RequiresMaxArgs(1), RunE: func(cmd *cobra.Command, args []string) error { if len(args) == 1 { @@ -70,42 +69,3 @@ func runCreate(dockerCli *command.DockerCli, opts createOptions) error { fmt.Fprintf(dockerCli.Out(), "%s\n", vol.Name) return nil } - -var createDescription = ` -Creates a new volume that containers can consume and store data in. If a name -is not specified, Docker generates a random name. You create a volume and then -configure the container to use it, for example: - - $ docker volume create hello - hello - $ docker run -d -v hello:/world busybox ls /world - -The mount is created inside the container's **/src** directory. Docker doesn't -not support relative paths for mount points inside the container. - -Multiple containers can use the same volume in the same time period. This is -useful if two containers need access to shared data. For example, if one -container writes and the other reads the data. - -## Driver specific options - -Some volume drivers may take options to customize the volume creation. Use the -**-o** or **--opt** flags to pass driver options: - - $ docker volume create --driver fake --opt tardis=blue --opt timey=wimey - -These options are passed directly to the volume driver. Options for different -volume drivers may do different things (or nothing at all). - -The built-in **local** driver on Windows does not support any options. - -The built-in **local** driver on Linux accepts options similar to the linux -**mount** command: - - $ docker volume create --driver local --opt type=tmpfs --opt device=tmpfs --opt o=size=100m,uid=1000 - -Another example: - - $ docker volume create --driver local --opt type=btrfs --opt device=/dev/sda2 - -` diff --git a/command/volume/inspect.go b/command/volume/inspect.go index 5eb8ad2516..f58b927ace 100644 --- a/command/volume/inspect.go +++ b/command/volume/inspect.go @@ -20,7 +20,6 @@ func newInspectCommand(dockerCli *command.DockerCli) *cobra.Command { cmd := &cobra.Command{ Use: "inspect [OPTIONS] VOLUME [VOLUME...]", Short: "Display detailed information on one or more volumes", - Long: inspectDescription, Args: cli.RequiresMinArgs(1), RunE: func(cmd *cobra.Command, args []string) error { opts.names = args @@ -45,11 +44,3 @@ func runInspect(dockerCli *command.DockerCli, opts inspectOptions) error { return inspect.Inspect(dockerCli.Out(), opts.names, opts.format, getVolFunc) } - -var inspectDescription = ` -Returns information about one or more volumes. By default, this command renders -all results in a JSON array. You can specify an alternate format to execute a -given template is executed for each result. Go's https://golang.org/pkg/text/template/ -package describes all the details of the format. - -` diff --git a/command/volume/list.go b/command/volume/list.go index d76006a1b2..0de83aea4e 100644 --- a/command/volume/list.go +++ b/command/volume/list.go @@ -34,7 +34,6 @@ func newListCommand(dockerCli *command.DockerCli) *cobra.Command { Use: "ls [OPTIONS]", Aliases: []string{"list"}, Short: "List volumes", - Long: listDescription, Args: cli.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { return runList(dockerCli, opts) @@ -73,19 +72,3 @@ func runList(dockerCli *command.DockerCli, opts listOptions) error { } return formatter.VolumeWrite(volumeCtx, volumes.Volumes) } - -var listDescription = ` - -Lists all the volumes Docker manages. You can filter using the **-f** or -**--filter** flag. The filtering format is a **key=value** pair. To specify -more than one filter, pass multiple flags (for example, -**--filter "foo=bar" --filter "bif=baz"**) - -The currently supported filters are: - -* **dangling** (boolean - **true** or **false**, **1** or **0**) -* **driver** (a volume driver's name) -* **label** (**label=** or **label==**) -* **name** (a volume's name) - -`