Add zsh completion for 'docker network connect --alias' and 'docker {create, run} --net-alias'

Signed-off-by: Steve Durrheimer <s.durrheimer@gmail.com>
This commit is contained in:
Steve Durrheimer 2016-01-19 21:25:21 +01:00 committed by Tibor Vass
parent 19f41be56b
commit b3b3392c97
1 changed files with 9 additions and 1 deletions

View File

@ -302,9 +302,10 @@ __docker_network_subcommand() {
opts_help=("(: -)--help[Print usage]") opts_help=("(: -)--help[Print usage]")
case "$words[1]" in case "$words[1]" in
(connect|disconnect) (connect)
_arguments $(__docker_arguments) \ _arguments $(__docker_arguments) \
$opts_help \ $opts_help \
"($help)*--alias=[Add network-scoped alias for the container]:alias: " \
"($help -)1:network:__docker_networks" \ "($help -)1:network:__docker_networks" \
"($help -)2:containers:__docker_containers" && ret=0 "($help -)2:containers:__docker_containers" && ret=0
;; ;;
@ -322,6 +323,12 @@ __docker_network_subcommand() {
"($help)*--subnet=[Subnet in CIDR format that represents a network segment]:IP/mask: " \ "($help)*--subnet=[Subnet in CIDR format that represents a network segment]:IP/mask: " \
"($help -)1:Network Name: " && ret=0 "($help -)1:Network Name: " && ret=0
;; ;;
(disconnect)
_arguments $(__docker_arguments) \
$opts_help \
"($help -)1:network:__docker_networks" \
"($help -)2:containers:__docker_containers" && ret=0
;;
(inspect) (inspect)
_arguments $(__docker_arguments) \ _arguments $(__docker_arguments) \
$opts_help \ $opts_help \
@ -506,6 +513,7 @@ __docker_subcommand() {
"($help)--mac-address=[Container MAC address]:MAC address: " "($help)--mac-address=[Container MAC address]:MAC address: "
"($help)--name=[Container name]:name: " "($help)--name=[Container name]:name: "
"($help)--net=[Connect a container to a network]:network mode:(bridge none container host)" "($help)--net=[Connect a container to a network]:network mode:(bridge none container host)"
"($help)*--net-alias=[Add network-scoped alias for the container]:alias: "
"($help)--oom-kill-disable[Disable OOM Killer]" "($help)--oom-kill-disable[Disable OOM Killer]"
"($help)--oom-score-adj[Tune the host's OOM preferences for containers (accepts -1000 to 1000)]" "($help)--oom-score-adj[Tune the host's OOM preferences for containers (accepts -1000 to 1000)]"
"($help -P --publish-all)"{-P,--publish-all}"[Publish all exposed ports]" "($help -P --publish-all)"{-P,--publish-all}"[Publish all exposed ports]"