From 9258d941b264451a0bf7afd05d329713119cf905 Mon Sep 17 00:00:00 2001 From: Segev Finer Date: Fri, 5 Jan 2018 22:10:14 +0200 Subject: [PATCH 1/2] 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 From ec601dd5bcb1593c5e0e5892223ac1fa583d7fd7 Mon Sep 17 00:00:00 2001 From: Segev Finer Date: Fri, 5 Jan 2018 22:16:45 +0200 Subject: [PATCH 2/2] Fix docker container update completion in Zsh A missing '$' 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 5ce5cdf751..3a47030b1e 100644 --- a/contrib/completion/zsh/_docker +++ b/contrib/completion/zsh/_docker @@ -923,7 +923,7 @@ __docker_container_subcommand() { local state _arguments $(__docker_arguments) \ $opts_help \ - opts_create_run_update \ + $opts_create_run_update \ "($help -)*: :->values" && ret=0 case $state in (values)