mirror of https://github.com/docker/cli.git
Merge pull request #5527 from albers/completion-container-rm
Improve completion of containers for `docker rm`
This commit is contained in:
commit
21eea1e003
|
@ -38,7 +38,9 @@ func NewRmCommand(dockerCli command.Cli) *cobra.Command {
|
||||||
Annotations: map[string]string{
|
Annotations: map[string]string{
|
||||||
"aliases": "docker container rm, docker container remove, docker rm",
|
"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()
|
flags := cmd.Flags()
|
||||||
|
|
Loading…
Reference in New Issue