Merge pull request #1928 from albers/completion-timeout

Bash completion for `docker-compose scale --timeout`
This commit is contained in:
Daniel Nephin 2015-08-27 12:37:55 -04:00
commit 21c16a787a
1 changed files with 13 additions and 9 deletions

View File

@ -223,7 +223,7 @@ _docker_compose_pull() {
_docker_compose_restart() {
case "$prev" in
-t | --timeout)
--timeout|-t)
return
;;
esac
@ -278,16 +278,20 @@ _docker_compose_scale() {
case "$prev" in
=)
COMPREPLY=("$cur")
return
;;
*)
COMPREPLY=( $(compgen -S "=" -W "$(___docker_compose_all_services_in_compose_file)" -- "$cur") )
compopt -o nospace
--timeout|-t)
return
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
COMPREPLY=( $( compgen -W "--help --timeout -t" -- "$cur" ) )
;;
*)
COMPREPLY=( $(compgen -S "=" -W "$(___docker_compose_all_services_in_compose_file)" -- "$cur") )
compopt -o nospace
;;
esac
}
@ -307,7 +311,7 @@ _docker_compose_start() {
_docker_compose_stop() {
case "$prev" in
-t | --timeout)
--timeout|-t)
return
;;
esac
@ -337,7 +341,7 @@ _docker_compose_unpause() {
_docker_compose_up() {
case "$prev" in
-t | --timeout)
--timeout|-t)
return
;;
esac
@ -398,11 +402,11 @@ _docker_compose() {
local compose_file compose_project
while [ $counter -lt $cword ]; do
case "${words[$counter]}" in
-f|--file)
--file|-f)
(( counter++ ))
compose_file="${words[$counter]}"
;;
-p|--project-name)
--project-name|p)
(( counter++ ))
compose_project="${words[$counter]}"
;;