aboutsummaryrefslogtreecommitdiff
path: root/completions/bash
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2019-09-07 06:24:34 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2019-09-07 06:29:07 -0400
commitf4ebfcb97d7bb95264ba973f5e615065c5828723 (patch)
tree99f92795de6c243f1b66750c590d0cb9e3f5ad49 /completions/bash
parent30cbb0091515a7f802f0f3f3ee486be6ff98f645 (diff)
downloadpodman-f4ebfcb97d7bb95264ba973f5e615065c5828723.tar.gz
podman-f4ebfcb97d7bb95264ba973f5e615065c5828723.tar.bz2
podman-f4ebfcb97d7bb95264ba973f5e615065c5828723.zip
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>
Diffstat (limited to 'completions/bash')
-rw-r--r--completions/bash/podman20
1 files changed, 14 insertions, 6 deletions
diff --git a/completions/bash/podman b/completions/bash/podman
index e6ffb135f..6ec700f11 100644
--- a/completions/bash/podman
+++ b/completions/bash/podman
@@ -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