mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #15260 from albers/completion-config
Add `--config` to bash completion
This commit is contained in:
commit
c4b9884ab5
1 changed files with 12 additions and 2 deletions
|
@ -27,7 +27,7 @@
|
||||||
# This order should be applied to lists, alternatives and code blocks.
|
# This order should be applied to lists, alternatives and code blocks.
|
||||||
|
|
||||||
__docker_q() {
|
__docker_q() {
|
||||||
docker ${host:+-H "$host"} 2>/dev/null "$@"
|
docker ${host:+-H "$host"} ${config:+--config "$config"} 2>/dev/null "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
__docker_containers_all() {
|
__docker_containers_all() {
|
||||||
|
@ -325,6 +325,10 @@ _docker_docker() {
|
||||||
"
|
"
|
||||||
|
|
||||||
case "$prev" in
|
case "$prev" in
|
||||||
|
--config)
|
||||||
|
_filedir -d
|
||||||
|
return
|
||||||
|
;;
|
||||||
--log-level|-l)
|
--log-level|-l)
|
||||||
__docker_log_levels
|
__docker_log_levels
|
||||||
return
|
return
|
||||||
|
@ -1394,6 +1398,7 @@ _docker() {
|
||||||
--tlsverify
|
--tlsverify
|
||||||
"
|
"
|
||||||
local global_options_with_args="
|
local global_options_with_args="
|
||||||
|
--config
|
||||||
--host -H
|
--host -H
|
||||||
--log-level -l
|
--log-level -l
|
||||||
--tlscacert
|
--tlscacert
|
||||||
|
@ -1401,7 +1406,7 @@ _docker() {
|
||||||
--tlskey
|
--tlskey
|
||||||
"
|
"
|
||||||
|
|
||||||
local host
|
local host config
|
||||||
|
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
local cur prev words cword
|
local cur prev words cword
|
||||||
|
@ -1416,6 +1421,11 @@ _docker() {
|
||||||
(( counter++ ))
|
(( counter++ ))
|
||||||
host="${words[$counter]}"
|
host="${words[$counter]}"
|
||||||
;;
|
;;
|
||||||
|
# save config so that completion can use custom configuration directories
|
||||||
|
--config)
|
||||||
|
(( counter++ ))
|
||||||
|
config="${words[$counter]}"
|
||||||
|
;;
|
||||||
$(__docker_to_extglob "$global_options_with_args") )
|
$(__docker_to_extglob "$global_options_with_args") )
|
||||||
(( counter++ ))
|
(( counter++ ))
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in a new issue