From 22579ba56cd5da8fa2808f1041b9dbc65738d40a Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Tue, 27 Jun 2017 12:19:37 +0200 Subject: [PATCH] Add bash completion for `network create --scope|--config-only|config-from` Signed-off-by: Harald Albers --- contrib/completion/bash/docker | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/contrib/completion/bash/docker b/contrib/completion/bash/docker index deab533c6a..7618c6fe76 100644 --- a/contrib/completion/bash/docker +++ b/contrib/completion/bash/docker @@ -2707,8 +2707,8 @@ _docker_network_create() { --aux-address|--gateway|--ip-range|--ipam-opt|--ipv6|--opt|-o|--subnet) return ;; - --ipam-driver) - COMPREPLY=( $( compgen -W "default" -- "$cur" ) ) + --config-from) + __docker_complete_networks return ;; --driver|-d) @@ -2716,14 +2716,22 @@ _docker_network_create() { __docker_complete_plugins_bundled --type Network --remove host --remove null --add macvlan return ;; + --ipam-driver) + COMPREPLY=( $( compgen -W "default" -- "$cur" ) ) + return + ;; --label) return ;; + --scope) + COMPREPLY=( $( compgen -W "local swarm" -- "$cur" ) ) + return + ;; esac case "$cur" in -*) - COMPREPLY=( $( compgen -W "--attachable --aux-address --driver -d --gateway --help --ingress --internal --ip-range --ipam-driver --ipam-opt --ipv6 --label --opt -o --subnet" -- "$cur" ) ) + COMPREPLY=( $( compgen -W "--attachable --aux-address --config-from --config-only --driver -d --gateway --help --ingress --internal --ip-range --ipam-driver --ipam-opt --ipv6 --label --opt -o --scope --subnet" -- "$cur" ) ) ;; esac }