From 9258d941b264451a0bf7afd05d329713119cf905 Mon Sep 17 00:00:00 2001 From: Segev Finer Date: Fri, 5 Jan 2018 22:10:14 +0200 Subject: [PATCH] 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 --- contrib/completion/zsh/_docker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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