Skip to content

Commit

Permalink
Merge pull request #5527 from albers/completion-container-rm
Browse files Browse the repository at this point in the history
Improve completion of containers for `docker rm`
  • Loading branch information
thaJeztah authored Oct 11, 2024
2 parents 88f1e99 + 147630a commit 21eea1e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cli/command/container/rm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 21eea1e

Please sign in to comment.