Merge pull request #17306 from albers/completion-log-driver-options
bash completion for log driver options `env` and `labels`
This commit is contained in:
commit
a2e5bbe640
1 changed files with 15 additions and 8 deletions
|
@ -315,6 +315,7 @@ __docker_capabilities() {
|
||||||
|
|
||||||
__docker_log_drivers() {
|
__docker_log_drivers() {
|
||||||
COMPREPLY=( $( compgen -W "
|
COMPREPLY=( $( compgen -W "
|
||||||
|
awslogs
|
||||||
fluentd
|
fluentd
|
||||||
gelf
|
gelf
|
||||||
journald
|
journald
|
||||||
|
@ -326,15 +327,21 @@ __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 tag"
|
|
||||||
local gelf_options="gelf-address tag"
|
|
||||||
local json_file_options="max-file max-size"
|
|
||||||
local syslog_options="syslog-address syslog-facility tag"
|
|
||||||
local awslogs_options="awslogs-region awslogs-group awslogs-stream"
|
local awslogs_options="awslogs-region awslogs-group awslogs-stream"
|
||||||
|
local fluentd_options="env fluentd-address labels tag"
|
||||||
|
local gelf_options="env gelf-address labels tag"
|
||||||
|
local journald_options="env labels"
|
||||||
|
local json_file_options="env labels max-file max-size"
|
||||||
|
local syslog_options="syslog-address syslog-facility tag"
|
||||||
|
|
||||||
|
local all_options="$fluentd_options $gelf_options $journald_options $json_file_options $syslog_options"
|
||||||
|
|
||||||
case $(__docker_value_of_option --log-driver) in
|
case $(__docker_value_of_option --log-driver) in
|
||||||
'')
|
'')
|
||||||
COMPREPLY=( $( compgen -W "$fluentd_options $gelf_options $json_file_options $syslog_options" -S = -- "$cur" ) )
|
COMPREPLY=( $( compgen -W "$all_options" -S = -- "$cur" ) )
|
||||||
|
;;
|
||||||
|
awslogs)
|
||||||
|
COMPREPLY=( $( compgen -W "$awslogs_options" -S = -- "$cur" ) )
|
||||||
;;
|
;;
|
||||||
fluentd)
|
fluentd)
|
||||||
COMPREPLY=( $( compgen -W "$fluentd_options" -S = -- "$cur" ) )
|
COMPREPLY=( $( compgen -W "$fluentd_options" -S = -- "$cur" ) )
|
||||||
|
@ -342,15 +349,15 @@ __docker_log_driver_options() {
|
||||||
gelf)
|
gelf)
|
||||||
COMPREPLY=( $( compgen -W "$gelf_options" -S = -- "$cur" ) )
|
COMPREPLY=( $( compgen -W "$gelf_options" -S = -- "$cur" ) )
|
||||||
;;
|
;;
|
||||||
|
journald)
|
||||||
|
COMPREPLY=( $( compgen -W "$journald_options" -S = -- "$cur" ) )
|
||||||
|
;;
|
||||||
json-file)
|
json-file)
|
||||||
COMPREPLY=( $( compgen -W "$json_file_options" -S = -- "$cur" ) )
|
COMPREPLY=( $( compgen -W "$json_file_options" -S = -- "$cur" ) )
|
||||||
;;
|
;;
|
||||||
syslog)
|
syslog)
|
||||||
COMPREPLY=( $( compgen -W "$syslog_options" -S = -- "$cur" ) )
|
COMPREPLY=( $( compgen -W "$syslog_options" -S = -- "$cur" ) )
|
||||||
;;
|
;;
|
||||||
awslogs)
|
|
||||||
COMPREPLY=( $( compgen -W "$awslogs_options" -S = -- "$cur" ) )
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in a new issue