Skip to content

Commit 3a72cea

Browse files
committed
Complete stopped containers correctly after docker rm -vf in Zsh
When using option-stacking the -f flag that controls completing stopped 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>
1 parent 220c50a commit 3a72cea

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

contrib/completion/zsh/_docker

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ __docker_container_subcommand() {
838838
"($help -)*:containers:->values" && ret=0
839839
case $state in
840840
(values)
841-
if [[ ${words[(r)-f]} == -f || ${words[(r)--force]} == --force ]]; then
841+
if [[ -n ${opt_args[(i)-f]} || -n ${opt_args[(i)--force]} ]]; then
842842
__docker_complete_containers && ret=0
843843
else
844844
__docker_complete_stopped_containers && ret=0

0 commit comments

Comments
 (0)