mirror of https://github.com/docker/cli.git
Only complete removable containers if --force is not given
Signed-off-by: Harald Albers <github@albersweb.de>
This commit is contained in:
parent
88f1e99e8e
commit
147630a309
|
@ -38,7 +38,9 @@ func NewRmCommand(dockerCli command.Cli) *cobra.Command {
|
|||
Annotations: map[string]string{
|
||||
"aliases": "docker container rm, docker container remove, docker rm",
|
||||
},
|
||||
ValidArgsFunction: completion.ContainerNames(dockerCli, true),
|
||||
ValidArgsFunction: completion.ContainerNames(dockerCli, true, func(ctr container.Summary) bool {
|
||||
return opts.force || ctr.State == "exited" || ctr.State == "created"
|
||||
}),
|
||||
}
|
||||
|
||||
flags := cmd.Flags()
|
||||
|
|
Loading…
Reference in New Issue