From 9b54d860cd8b131890b92e8591c6ddd650f4d340 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Mon, 23 Jan 2023 22:25:06 +0900 Subject: [PATCH] rm: allow `docker container remove` as an alias Fix issue 3985 Signed-off-by: Akihiro Suda --- cli/command/container/rm.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cli/command/container/rm.go b/cli/command/container/rm.go index b98b3e76fe..70a78e84fb 100644 --- a/cli/command/container/rm.go +++ b/cli/command/container/rm.go @@ -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), }