From 5b6fdb11a8ae8cb7e331ed2b2dd9a672cc284da0 Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Sat, 12 Nov 2016 10:32:08 -0800 Subject: [PATCH] Add bash completion for `docker build --network` Signed-off-by: Harald Albers --- contrib/completion/bash/docker | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index 25779590f5..1d8345595d 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -1914,6 +1914,7 @@ _docker_image_build() { --label --memory -m --memory-swap + --network --shm-size --tag -t --ulimit @@ -1950,6 +1951,20 @@ _docker_image_build() { __docker_complete_isolation return ;; + --network) + case "$cur" in + container:*) + __docker_complete_containers_all --cur "${cur#*:}" + ;; + *) + COMPREPLY=( $( compgen -W "$(__docker_plugins --type Network) $(__docker_networks) container:" -- "$cur") ) + if [ "${COMPREPLY[*]}" = "container:" ] ; then + __docker_nospace + fi + ;; + esac + return + ;; --tag|-t) __docker_complete_image_repos_and_tags return