feat(docker): add context argument completion

Signed-off-by: acouvreur <alexiscouvreur.pro@gmail.com>
(cherry picked from commit 79638e6ea4)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
acouvreur 2021-06-10 09:13:19 +02:00 committed by Sebastiaan van Stijn
parent a39f3fbdfd
commit 1ea8d69d6f
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 3 additions and 1 deletions

View File

@ -3094,6 +3094,7 @@ _docker() {
_arguments $(__docker_arguments) -C \ _arguments $(__docker_arguments) -C \
"(: -)"{-h,--help}"[Print usage]" \ "(: -)"{-h,--help}"[Print usage]" \
"($help)--config[Location of client config files]:path:_directories" \ "($help)--config[Location of client config files]:path:_directories" \
"($help -c --context)"{-c=,--context=}"[Execute the command in a docker context]:context:__docker_complete_contexts" \
"($help -D --debug)"{-D,--debug}"[Enable debug mode]" \ "($help -D --debug)"{-D,--debug}"[Enable debug mode]" \
"($help -H --host)"{-H=,--host=}"[tcp://host:port to bind/connect to]:host: " \ "($help -H --host)"{-H=,--host=}"[tcp://host:port to bind/connect to]:host: " \
"($help -l --log-level)"{-l=,--log-level=}"[Logging level]:level:(debug info warn error fatal)" \ "($help -l --log-level)"{-l=,--log-level=}"[Logging level]:level:(debug info warn error fatal)" \
@ -3109,7 +3110,8 @@ _docker() {
local host=${opt_args[-H]}${opt_args[--host]} local host=${opt_args[-H]}${opt_args[--host]}
local config=${opt_args[--config]} local config=${opt_args[--config]}
local docker_options="${host:+--host $host} ${config:+--config $config}" local context=${opt_args[-c]}${opt_args[--context]}
local docker_options="${host:+--host $host} ${config:+--config $config} ${context:+--context $context} "
case $state in case $state in
(command) (command)