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>
This commit is contained in:
Segev Finer 2018-01-05 22:10:14 +02:00
parent 220c50abc1
commit 9258d941b2
1 changed files with 1 additions and 1 deletions

View File

@ -838,7 +838,7 @@ __docker_container_subcommand() {
"($help -)*:containers:->values" && ret=0 "($help -)*:containers:->values" && ret=0
case $state in case $state in
(values) (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 __docker_complete_containers && ret=0
else else
__docker_complete_stopped_containers && ret=0 __docker_complete_stopped_containers && ret=0