Fix podman import bash completions

podman import bash completions are throwing errors.  Updated this completion
to work correctly.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh 2019-09-07 06:24:34 -04:00
parent 30cbb00915
commit f4ebfcb97d
No known key found for this signature in database
GPG Key ID: A2DF901DABE2C028
1 changed files with 14 additions and 6 deletions

View File

@ -1,3 +1,7 @@
#
# This bash script was originally copied and converted from the upstream
# github.com:docker/docker project
#
: ${PROG:=$(basename ${BASH_SOURCE})}
@ -1390,20 +1394,24 @@ _podman_import() {
--quiet
-q
"
_complete_ "$options_with_args" "$boolean_options"
case "$prev" in
--change|-c|--message|-m)
return
;;
esac
case "$cur" in
-*)
COMPREPLY=($(compgen -W "$boolean_options $options_with_args" -- "$cur"))
;;
*)
local counter=$( __podman_pos_first_nonflag "$options_with_args" )
if [ "$cword" -eq "$((counter))" ]; then
__podman_complete_images --repo --tag
return
else
local counter=$(__podman_pos_first_nonflag '--change|-c|--message|-m')
if [ "$cword" -eq "$counter" ]; then
_filedir
return
elif [ "$cword" -eq "$((counter + 1))" ]; then
__podman_complete_images --repo --tag
return
fi
;;
esac