mirror of https://github.com/docker/cli.git
Merge pull request #3986 from AkihiroSuda/docker-container-remove
rm: allow `docker container remove` as an alias
This commit is contained in:
commit
4a500f690f
|
@ -27,15 +27,16 @@ func NewRmCommand(dockerCli command.Cli) *cobra.Command {
|
||||||
var opts rmOptions
|
var opts rmOptions
|
||||||
|
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "rm [OPTIONS] CONTAINER [CONTAINER...]",
|
Use: "rm [OPTIONS] CONTAINER [CONTAINER...]",
|
||||||
Short: "Remove one or more containers",
|
Aliases: []string{"remove"},
|
||||||
Args: cli.RequiresMinArgs(1),
|
Short: "Remove one or more containers",
|
||||||
|
Args: cli.RequiresMinArgs(1),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
opts.containers = args
|
opts.containers = args
|
||||||
return runRm(dockerCli, &opts)
|
return runRm(dockerCli, &opts)
|
||||||
},
|
},
|
||||||
Annotations: map[string]string{
|
Annotations: map[string]string{
|
||||||
"aliases": "docker container rm, docker rm",
|
"aliases": "docker container rm, docker container remove, docker rm",
|
||||||
},
|
},
|
||||||
ValidArgsFunction: completion.ContainerNames(dockerCli, true),
|
ValidArgsFunction: completion.ContainerNames(dockerCli, true),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue