Skip to content

Commit 74e4649

Browse files
segevfinerthaJeztah
authored andcommitted
Complete running containers correctly after docker rm -vf in Zsh
When using option-stacking the -f flag that controls completing running containers can be a part of another word of options, so use opt_args that contains the parsed arguments from _arguments to check for it instead. Signed-off-by: Segev Finer <segev208@gmail.com>
1 parent 2ea4dc1 commit 74e4649

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

contrib/completion/zsh/_docker

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ __docker_container_subcommand() {
848848
"($help -)*:containers:->values" && ret=0
849849
case $state in
850850
(values)
851-
if [[ ${words[(r)-f]} == -f || ${words[(r)--force]} == --force ]]; then
851+
if [[ -n ${opt_args[(i)-f]} || -n ${opt_args[(i)--force]} ]]; then
852852
__docker_complete_containers && ret=0
853853
else
854854
__docker_complete_stopped_containers && ret=0

0 commit comments

Comments
 (0)