Fix bash completion for log driver options

This option was incorrectly ported to the new `daemon` subcommand
structure.

Beside the obvious effect that completion of `docker daemon --log-opt`
did not work, this also caused completion of `docker` and `docker xxx`
to fail on macs with

> bash: words: bad array subscript

Signed-off-by: Harald Albers <github@albersweb.de>
This commit is contained in:
Harald Albers 2015-08-17 15:48:50 +02:00 committed by Tibor Vass
parent 56632110e0
commit 8d6fd1542f
1 changed files with 3 additions and 2 deletions

View File

@ -342,8 +342,6 @@ _docker_docker() {
;; ;;
esac esac
__docker_complete_log_driver_options && return
case "$cur" in case "$cur" in
-*) -*)
COMPREPLY=( $( compgen -W "$boolean_options $global_options_with_args" -- "$cur" ) ) COMPREPLY=( $( compgen -W "$boolean_options $global_options_with_args" -- "$cur" ) )
@ -564,6 +562,9 @@ _docker_daemon() {
;; ;;
esac esac
__docker_complete_log_driver_options && return
# completions for --storage-opt
case "${words[$cword-2]}$prev=" in case "${words[$cword-2]}$prev=" in
*dm.blkdiscard=*) *dm.blkdiscard=*)
COMPREPLY=( $( compgen -W "false true" -- "${cur#=}" ) ) COMPREPLY=( $( compgen -W "false true" -- "${cur#=}" ) )