From 1c56dfab6f0ccba67e0564f4ec8d1f9905d7a8cd Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Fri, 17 Mar 2017 09:21:21 +0100 Subject: [PATCH] Improve bash completion for `docker rm` `docker rm` can delete containers in state=created, too. Signed-off-by: Harald Albers --- contrib/completion/bash/docker | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index 9c43498bc0..d4f3a2083f 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -101,6 +101,10 @@ __docker_complete_containers_all() { __docker_complete_containers "$@" --all } +__docker_complete_containers_removable() { + __docker_complete_containers "$@" --filter status=created --filter status=exited +} + __docker_complete_containers_running() { __docker_complete_containers "$@" --filter status=running } @@ -1430,7 +1434,7 @@ _docker_container_rm() { ;; esac done - __docker_complete_containers_stopped + __docker_complete_containers_removable ;; esac }