diff --git a/contrib/completion/zsh/_docker b/contrib/completion/zsh/_docker index e027877143..5ce5cdf751 100644 --- a/contrib/completion/zsh/_docker +++ b/contrib/completion/zsh/_docker @@ -838,7 +838,7 @@ __docker_container_subcommand() { "($help -)*:containers:->values" && ret=0 case $state in (values) - if [[ ${words[(r)-f]} == -f || ${words[(r)--force]} == --force ]]; then + if [[ -n ${opt_args[(i)-f]} || -n ${opt_args[(i)--force]} ]]; then __docker_complete_containers && ret=0 else __docker_complete_stopped_containers && ret=0