mirror of https://github.com/docker/docs.git
Merge pull request #14901 from albers/completion-log-opt-fixes
Fixes to bash completion for log driver options
This commit is contained in:
commit
2cf9fec111
|
@ -227,15 +227,22 @@ __docker_log_drivers() {
|
||||||
|
|
||||||
__docker_log_driver_options() {
|
__docker_log_driver_options() {
|
||||||
# see docs/reference/logging/index.md
|
# see docs/reference/logging/index.md
|
||||||
|
local fluentd_options="fluentd-address fluentd-tag"
|
||||||
|
local gelf_options="gelf-address gelf-tag"
|
||||||
|
local syslog_options="syslog-address syslog-facility syslog-tag"
|
||||||
|
|
||||||
case $(__docker_value_of_option --log-driver) in
|
case $(__docker_value_of_option --log-driver) in
|
||||||
|
'')
|
||||||
|
COMPREPLY=( $( compgen -W "$fluentd_options $gelf_options $syslog_options" -S = -- "$cur" ) )
|
||||||
|
;;
|
||||||
fluentd)
|
fluentd)
|
||||||
COMPREPLY=( $( compgen -W "fluentd-address fluentd-tag" -S = -- "$cur" ) )
|
COMPREPLY=( $( compgen -W "$fluentd_options" -S = -- "$cur" ) )
|
||||||
;;
|
;;
|
||||||
gelf)
|
gelf)
|
||||||
COMPREPLY=( $( compgen -W "gelf-address gelf-tag" -S = -- "$cur" ) )
|
COMPREPLY=( $( compgen -W "$gelf_options" -S = -- "$cur" ) )
|
||||||
;;
|
;;
|
||||||
syslog)
|
syslog)
|
||||||
COMPREPLY=( $( compgen -W "syslog-address syslog-facility syslog-tag" -S = -- "$cur" ) )
|
COMPREPLY=( $( compgen -W "$syslog_options" -S = -- "$cur" ) )
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
return
|
return
|
||||||
|
@ -359,7 +366,10 @@ _docker_docker() {
|
||||||
COMPREPLY=( $( compgen -W "$boolean_options $main_options_with_args" -- "$cur" ) )
|
COMPREPLY=( $( compgen -W "$boolean_options $main_options_with_args" -- "$cur" ) )
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
local counter="$(__docker_pos_first_nonflag $main_options_with_args_glob)"
|
||||||
|
if [ $cword -eq $counter ]; then
|
||||||
COMPREPLY=( $( compgen -W "${commands[*]} help" -- "$cur" ) )
|
COMPREPLY=( $( compgen -W "${commands[*]} help" -- "$cur" ) )
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue