From 6a41b34f89242b6fe1e673b03708a7b72943dabd Mon Sep 17 00:00:00 2001 From: Tianyi Wang Date: Mon, 30 May 2016 18:07:15 +0900 Subject: [PATCH] Fix zsh completion - List all containers on `docker rm -f` Signed-off-by: Tianyi Wang --- contrib/completion/zsh/_docker | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/contrib/completion/zsh/_docker b/contrib/completion/zsh/_docker index 8ac3e7fe49..8cd11199a4 100644 --- a/contrib/completion/zsh/_docker +++ b/contrib/completion/zsh/_docker @@ -1138,7 +1138,16 @@ __docker_subcommand() { "($help -f --force)"{-f,--force}"[Force removal]" \ "($help -l --link)"{-l,--link}"[Remove the specified link and not the underlying container]" \ "($help -v --volumes)"{-v,--volumes}"[Remove the volumes associated to the container]" \ - "($help -)*:containers:__docker_stoppedcontainers" && ret=0 + "($help -)*:containers:->values" && ret=0 + case $state in + (values) + if [[ ${words[(r)-f]} == -f || ${words[(r)--force]} == --force ]]; then + __docker_containers && ret=0 + else + __docker_stoppedcontainers && ret=0 + fi + ;; + esac ;; (rmi) _arguments $(__docker_arguments) \