Add bash completion for `{stack services,service ls} --format`

Signed-off-by: Harald Albers <github@albersweb.de>
This commit is contained in:
Harald Albers 2017-02-03 13:09:46 +01:00 committed by Tibor Vass
parent 50d1d4ecba
commit f7e0aa39fa
1 changed files with 9 additions and 3 deletions

View File

@ -2857,11 +2857,14 @@ _docker_service_ls() {
__docker_nospace
return
;;
--format)
return
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--filter -f --help --quiet -q" -- "$cur" ) )
COMPREPLY=( $( compgen -W "--filter -f --format --help --quiet -q" -- "$cur" ) )
;;
esac
}
@ -3908,14 +3911,17 @@ _docker_stack_services() {
__docker_nospace
return
;;
--format)
return
;;
esac
case "$cur" in
-*)
COMPREPLY=( $( compgen -W "--filter -f --help --quiet -q" -- "$cur" ) )
COMPREPLY=( $( compgen -W "--filter -f --format --help --quiet -q" -- "$cur" ) )
;;
*)
local counter=$(__docker_pos_first_nonflag '--filter|-f')
local counter=$(__docker_pos_first_nonflag '--filter|-f|--format')
if [ $cword -eq $counter ]; then
__docker_complete_stacks
fi