summaryrefslogtreecommitdiff
path: root/completions/bash/podman
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-01-03 10:26:10 -0800
committerGitHub <noreply@github.com>2019-01-03 10:26:10 -0800
commit133469681486788591f6979f853c662ccf7f9118 (patch)
treeb9bf8ac2aab58d2baa9aafff45c323528767bda9 /completions/bash/podman
parent098c13418abf3985f20689bdda0361904a40ef98 (diff)
parent0c26aec2ae8df4781e5f6fece0398d2b1e690fab (diff)
downloadpodman-133469681486788591f6979f853c662ccf7f9118.tar.gz
podman-133469681486788591f6979f853c662ccf7f9118.tar.bz2
podman-133469681486788591f6979f853c662ccf7f9118.zip
Merge pull request #2072 from rhatdan/completions
Fix completions
Diffstat (limited to 'completions/bash/podman')
-rw-r--r--completions/bash/podman39
1 files changed, 36 insertions, 3 deletions
diff --git a/completions/bash/podman b/completions/bash/podman
index a85574d10..d65f54690 100644
--- a/completions/bash/podman
+++ b/completions/bash/podman
@@ -47,10 +47,10 @@ __podman_pods() {
format='{{.ID}}'
shift
elif [ "$1" = "--name" ] ; then
- format='{{.Names}}'
+ format='{{.Name}}'
shift
else
- format='{{.Names}}'
+ format='{{.Name}}'
fi
__podman_q pod ps --format "$format" "$@"
}
@@ -1194,7 +1194,14 @@ _podman_import() {
COMPREPLY=($(compgen -W "$boolean_options $options_with_args" -- "$cur"))
;;
*)
- __podman_list_images
+ local counter=$( __podman_pos_first_nonflag "$options_with_args" )
+ if [ "$cword" -eq "$((counter))" ]; then
+ __podman_complete_images --repo --tag
+ return
+ else
+ _filedir
+ return
+ fi
;;
esac
}
@@ -2271,10 +2278,26 @@ _podman_generate_kube() {
local options_with_args=""
local boolean_options="
+ -h
+ --help
-s
--service
"
+ case "$cur" in
+ -*)
+ COMPREPLY=($(compgen -W "$boolean_options $options_with_args" -- "$cur"))
+ ;;
+ *)
+ COMPREPLY=( $( compgen -W "
+ $(__podman_containers --all)
+ $(__podman_pods)
+ " -- "$cur" ) )
+ __ltrim_colon_completions "$cur"
+ ;;
+ esac
+}
+
_podman_play_kube() {
local options_with_args="
--authfile
@@ -2291,6 +2314,16 @@ _podman_play_kube() {
--tls-verify
"
+ case "$cur" in
+ -*)
+ COMPREPLY=($(compgen -W "$boolean_options $options_with_args" -- "$cur"))
+ ;;
+ *)
+ _filedir
+ ;;
+ esac
+}
+
_podman_container_runlabel() {
local options_with_args="
--authfile