Fix bash completion for `docker service create|update

Signed-off-by: Harald Albers <github@albersweb.de>
This commit is contained in:
Harald Albers 2016-12-04 12:11:33 -08:00 committed by Tibor Vass
parent 6afaa9c01f
commit b6365dc413
1 changed files with 9 additions and 1 deletions

View File

@ -2874,9 +2874,17 @@ _docker_service_update() {
COMPREPLY=( $( compgen -W "$boolean_options $options_with_args" -- "$cur" ) )
;;
*)
local counter=$( __docker_pos_first_nonflag $( __docker_to_alternatives "$options_with_args" ) )
if [ "$subcommand" = "update" ] ; then
__docker_complete_services
if [ $cword -eq $counter ]; then
__docker_complete_services
fi
else
if [ $cword -eq $counter ]; then
__docker_complete_images
fi
fi
;;
esac
}