rm: allow `docker container remove` as an alias

Fix issue 3985

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
Akihiro Suda 2023-01-23 22:25:06 +09:00
parent 0288f7f724
commit 9b54d860cd
No known key found for this signature in database
GPG Key ID: 49524C6F9F638F1A
1 changed files with 5 additions and 4 deletions

View File

@ -27,15 +27,16 @@ func NewRmCommand(dockerCli command.Cli) *cobra.Command {
var opts rmOptions
cmd := &cobra.Command{
Use: "rm [OPTIONS] CONTAINER [CONTAINER...]",
Short: "Remove one or more containers",
Args: cli.RequiresMinArgs(1),
Use: "rm [OPTIONS] CONTAINER [CONTAINER...]",
Aliases: []string{"remove"},
Short: "Remove one or more containers",
Args: cli.RequiresMinArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.containers = args
return runRm(dockerCli, &opts)
},
Annotations: map[string]string{
"aliases": "docker container rm, docker rm",
"aliases": "docker container rm, docker container remove, docker rm",
},
ValidArgsFunction: completion.ContainerNames(dockerCli, true),
}