Minor bash completion improvements/fixes

Signed-off-by: Harald Albers <github@albersweb.de>
This commit is contained in:
Harald Albers 2017-11-29 11:17:20 +01:00
parent 5ee3b9b461
commit 53376b60c6
1 changed files with 5 additions and 13 deletions

View File

@ -1372,10 +1372,7 @@ _docker_container_commit() {
if [ "$cword" -eq "$counter" ]; then
__docker_complete_containers_all
return
fi
(( counter++ ))
if [ "$cword" -eq "$counter" ]; then
elif [ "$cword" -eq "$((counter + 1))" ]; then
__docker_complete_images --repo --tag
return
fi
@ -2593,7 +2590,7 @@ _docker_image_history() {
COMPREPLY=( $( compgen -W "--format --help --human=false -H=false --no-trunc --quiet -q" -- "$cur" ) )
;;
*)
local counter=$(__docker_pos_first_nonflag)
local counter=$(__docker_pos_first_nonflag '--format')
if [ "$cword" -eq "$counter" ]; then
__docker_complete_images --force-tag --id
fi
@ -2619,11 +2616,9 @@ _docker_image_import() {
*)
local counter=$(__docker_pos_first_nonflag '--change|-c|--message|-m')
if [ "$cword" -eq "$counter" ]; then
_filedir
return
fi
(( counter++ ))
if [ "$cword" -eq "$counter" ]; then
elif [ "$cword" -eq "$((counter + 1))" ]; then
__docker_complete_images --repo --tag
return
fi
@ -2798,10 +2793,7 @@ _docker_image_tag() {
if [ "$cword" -eq "$counter" ]; then
__docker_complete_images --force-tag --id
return
fi
(( counter++ ))
if [ "$cword" -eq "$counter" ]; then
elif [ "$cword" -eq "$((counter + 1))" ]; then
__docker_complete_images --repo --tag
return
fi