From a584bd3b1ae2ab2a61b7359137f540fbb70e57ff Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Mon, 27 Feb 2017 12:56:57 +0100 Subject: [PATCH] Add bash completion for `docker build --add-host` Signed-off-by: Harald Albers --- contrib/completion/bash/docker | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index a41adcf56b..7d262ebb8c 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -2155,6 +2155,7 @@ _docker_image() { _docker_image_build() { local options_with_args=" + --add-host --build-arg --cache-from --cgroup-parent @@ -2191,6 +2192,14 @@ _docker_image_build() { local all_options="$options_with_args $boolean_options" case "$prev" in + --add-host) + case "$cur" in + *:) + __docker_complete_resolved_hostname + return + ;; + esac + ;; --build-arg) COMPREPLY=( $( compgen -e -- "$cur" ) ) __docker_nospace