From 578a431fb3e6ac18e80018a5fb0e6e5896a1e716 Mon Sep 17 00:00:00 2001 From: Vincent Demeester Date: Mon, 27 Mar 2017 09:58:09 +0200 Subject: [PATCH] Add support for `--type=secret` in `docker inspect` Signed-off-by: Vincent Demeester --- contrib/completion/bash/docker | 6 +++++- contrib/completion/zsh/_docker | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index b120063d84..1ef23d809a 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -2511,7 +2511,7 @@ _docker_inspect() { ;; --type) if [ -z "$preselected_type" ] ; then - COMPREPLY=( $( compgen -W "container image network node plugin service volume" -- "$cur" ) ) + COMPREPLY=( $( compgen -W "container image network node plugin secret service volume" -- "$cur" ) ) return fi ;; @@ -2534,6 +2534,7 @@ _docker_inspect() { $(__docker_networks) $(__docker_nodes) $(__docker_plugins_installed) + $(__docker_secrets) $(__docker_services) $(__docker_volumes) " -- "$cur" ) ) @@ -2553,6 +2554,9 @@ _docker_inspect() { plugin) __docker_complete_plugins_installed ;; + secret) + __docker_complete_secrets + ;; service) __docker_complete_services ;; diff --git a/contrib/completion/zsh/_docker b/contrib/completion/zsh/_docker index 3c91fce887..86fc6081b8 100644 --- a/contrib/completion/zsh/_docker +++ b/contrib/completion/zsh/_docker @@ -2729,6 +2729,8 @@ __docker_subcommand() { __docker_complete_nodes && ret=0 elif [[ ${words[(r)--type=plugin]} == --type=plugin ]]; then __docker_complete_plugins && ret=0 + elif [[ ${words[(r)--type=service]} == --type=secrets ]]; then + __docker_complete_secrets && ret=0 elif [[ ${words[(r)--type=service]} == --type=service ]]; then __docker_complete_services && ret=0 elif [[ ${words[(r)--type=volume]} == --type=volume ]]; then @@ -2739,6 +2741,7 @@ __docker_subcommand() { __docker_complete_networks __docker_complete_nodes __docker_complete_plugins + __docker_complete_secrets __docker_complete_services __docker_complete_volumes && ret=0 fi