Merge pull request #248 from albers/completion-network-create--scope

Add bash completion for `network create --scope|--config-only|config-from`
This commit is contained in:
Victor Vieux 2017-07-04 16:48:18 +02:00 committed by GitHub
commit 306212574a
1 changed files with 11 additions and 3 deletions

View File

@ -2752,8 +2752,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)
@ -2761,14 +2761,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
}