cli/command/volume: remove example and var for long description

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 <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2025-02-01 19:31:47 +01:00
parent 13ef82974d
commit 987da09578
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
2 changed files with 1 additions and 13 deletions

View File

@ -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
@ -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
`

View File

@ -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`