Fix suppressed blank in completion of `scale --help`

Wrong placement of `compopt -o` introduces an unexpected behavior that did
not matter as long as --help was the only option (you would probably not
continue to type after --help): completion of options would not automatically
append a whitespace character as expected.

For the outstanding addition of the --timeout option, which has an
argument, this would mean that the user would have to type an extra
whitespace after completion of --timeout before the argument could be
added.

Signed-off-by: Harald Albers <github@albersweb.de>
This commit is contained in:
Harald Albers 2015-08-26 17:48:51 +02:00
parent fc63454c99
commit 7e22719090
1 changed files with 5 additions and 4 deletions

View File

@ -278,10 +278,7 @@ _docker_compose_scale() {
case "$prev" in case "$prev" in
=) =)
COMPREPLY=("$cur") COMPREPLY=("$cur")
;; return
*)
COMPREPLY=( $(compgen -S "=" -W "$(___docker_compose_all_services_in_compose_file)" -- "$cur") )
compopt -o nospace
;; ;;
esac esac
@ -289,6 +286,10 @@ _docker_compose_scale() {
-*) -*)
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) ) COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
;; ;;
*)
COMPREPLY=( $(compgen -S "=" -W "$(___docker_compose_all_services_in_compose_file)" -- "$cur") )
compopt -o nospace
;;
esac esac
} }