From 57062f2a4472e04a799aac1ecb48f6a8bf99bfef Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Sat, 1 Aug 2015 08:36:00 -0700 Subject: [PATCH] Filter completions of `docker inspect` by `--type` Completion now filters the images and containers by given `--type`. Signed-off-by: Harald Albers --- contrib/completion/bash/docker | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index 59d8a869ee..dcccd142d1 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -738,8 +738,17 @@ _docker_inspect() { COMPREPLY=( $( compgen -W "--format -f --type --help" -- "$cur" ) ) ;; *) - __docker_containers_and_images - ;; + case $(__docker_value_of_option --type) in + '') + __docker_containers_and_images + ;; + container) + __docker_containers_all + ;; + image) + __docker_image_repos_and_tags_and_ids + ;; + esac esac }