Skip to content

Commit

Permalink
cli/command/volume: remove example and var for long description
Browse files Browse the repository at this point in the history
This was the only command for which we set the "example" field; while
we could consider doing this for other commands, we need to look what's
best w.r.t. duplicating the information maintained in markdown.

Also remove the intermediate variable used for the long description,
as this was also the only location where we used one.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
thaJeztah committed Feb 1, 2025
1 parent 0fdcbbb commit 68ea878
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
12 changes: 1 addition & 11 deletions cli/command/volume/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ func newRemoveCommand(dockerCli command.Cli) *cobra.Command {
Use: "rm [OPTIONS] VOLUME [VOLUME...]",
Aliases: []string{"remove"},
Short: "Remove one or more volumes",
Long: removeDescription,
Example: removeExample,
Long: "Remove one or more volumes. You cannot remove a volume that is in use by a container.",
Args: cli.RequiresMinArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.volumes = args
Expand Down Expand Up @@ -59,12 +58,3 @@ func runRemove(ctx context.Context, dockerCLI command.Cli, opts *removeOptions)
}
return nil
}

var removeDescription = `
Remove one or more volumes. You cannot remove a volume that is in use by a container.
`

var removeExample = `
$ docker volume rm hello
hello
`
2 changes: 0 additions & 2 deletions docs/reference/commandline/volume_rm.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# volume rm

<!---MARKER_GEN_START-->

Remove one or more volumes. You cannot remove a volume that is in use by a container.


### Aliases

`docker volume rm`, `docker volume remove`
Expand Down

0 comments on commit 68ea878

Please sign in to comment.