Move bash completion logic to new subcommand: import
Signed-off-by: Harald Albers <github@albersweb.de>
This commit is contained in:
parent
9059b9532e
commit
e93298650d
1 changed files with 24 additions and 24 deletions
|
@ -2075,7 +2075,29 @@ _docker_image_images() {
|
|||
}
|
||||
|
||||
_docker_image_import() {
|
||||
_docker_import
|
||||
case "$prev" in
|
||||
--change|-c|--message|-m)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--change -c --help --message -m" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
local counter=$(__docker_pos_first_nonflag '--change|-c|--message|-m')
|
||||
if [ $cword -eq $counter ]; then
|
||||
return
|
||||
fi
|
||||
(( counter++ ))
|
||||
|
||||
if [ $cword -eq $counter ]; then
|
||||
__docker_complete_image_repos_and_tags
|
||||
return
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
_docker_image_inspect() {
|
||||
|
@ -2175,29 +2197,7 @@ _docker_images() {
|
|||
}
|
||||
|
||||
_docker_import() {
|
||||
case "$prev" in
|
||||
--change|-c|--message|-m)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--change -c --help --message -m" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
local counter=$(__docker_pos_first_nonflag '--change|-c|--message|-m')
|
||||
if [ $cword -eq $counter ]; then
|
||||
return
|
||||
fi
|
||||
(( counter++ ))
|
||||
|
||||
if [ $cword -eq $counter ]; then
|
||||
__docker_complete_image_repos_and_tags
|
||||
return
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
_docker_image_import
|
||||
}
|
||||
|
||||
_docker_info() {
|
||||
|
|
Loading…
Reference in a new issue