Skip to content

Commit

Permalink
Complete all known driver options if no log driver was specified
Browse files Browse the repository at this point in the history
Without this fix, `docker --log-opt ` would not complete anything
because the completions were driver specific.

Signed-off-by: Harald Albers <github@albersweb.de>
  • Loading branch information
albers committed Jul 23, 2015
1 parent 6de8dd1 commit de40f39
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions contrib/completion/bash/docker
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,22 @@ __docker_log_drivers() {

__docker_log_driver_options() {
# 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
'')
COMPREPLY=( $( compgen -W "$fluentd_options $gelf_options $syslog_options" -S = -- "$cur" ) )
;;
fluentd)
COMPREPLY=( $( compgen -W "fluentd-address fluentd-tag" -S = -- "$cur" ) )
COMPREPLY=( $( compgen -W "$fluentd_options" -S = -- "$cur" ) )
;;
gelf)
COMPREPLY=( $( compgen -W "gelf-address gelf-tag" -S = -- "$cur" ) )
COMPREPLY=( $( compgen -W "$gelf_options" -S = -- "$cur" ) )
;;
syslog)
COMPREPLY=( $( compgen -W "syslog-address syslog-facility syslog-tag" -S = -- "$cur" ) )
COMPREPLY=( $( compgen -W "$syslog_options" -S = -- "$cur" ) )
;;
*)
return
Expand Down

0 comments on commit de40f39

Please sign in to comment.