Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[20.10 backport] feat(docker): add context argument completion #3814

Merged
merged 1 commit into from Oct 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion contrib/completion/zsh/_docker
Expand Up @@ -3094,6 +3094,7 @@ _docker() {
_arguments $(__docker_arguments) -C \
"(: -)"{-h,--help}"[Print usage]" \
"($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 -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)" \
Expand All @@ -3109,7 +3110,8 @@ _docker() {

local host=${opt_args[-H]}${opt_args[--host]}
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
(command)
Expand Down