about summary refs log tree commit diff
path: root/Completion/Unix/Command/_ansible
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2024-03-18 21:12:55 +0100
committerOliver Kiddle <opk@zsh.org>2024-03-18 21:12:55 +0100
commit1e995cbb384ddc931ba025a0f1cbc210d259f588 (patch)
tree312872de221ed68aad3305b8211fab533655a5c7 /Completion/Unix/Command/_ansible
parent57248b88830ce56adc243a40c7773fb3825cab34 (diff)
downloadzsh-1e995cbb384ddc931ba025a0f1cbc210d259f588.tar.gz
zsh-1e995cbb384ddc931ba025a0f1cbc210d259f588.tar.xz
zsh-1e995cbb384ddc931ba025a0f1cbc210d259f588.zip
52769: fix completion of ansible keywords and --step option
Diffstat (limited to 'Completion/Unix/Command/_ansible')
-rw-r--r--Completion/Unix/Command/_ansible14
1 files changed, 7 insertions, 7 deletions
diff --git a/Completion/Unix/Command/_ansible b/Completion/Unix/Command/_ansible
index bf31819ad..e0d9fb9b6 100644
--- a/Completion/Unix/Command/_ansible
+++ b/Completion/Unix/Command/_ansible
@@ -69,6 +69,11 @@ case $service in
       "--skip-tags[only run plays and tasks whose tags don't match]"
     )
   ;|
+  ansible-playbook|ansible-console)
+    args+=(
+      '--step[one-step-at-a-time: confirm each task before running]'
+    )
+  ;|
   ansible|ansible-console)
     args+=(
       '--task-timeout[set the task timeout limit]:timeout (seconds)'
@@ -97,11 +102,6 @@ case $service in
       '*::args:->config'
     )
   ;;
-  ansible-console)
-    args+=(
-      '--step[one-step-at-a-time: confirm each task before running]'
-    )
-  ;;
   ansible-doc)
     args+=(
       '!--metadata-dump' '!--no-fail-on-errors' # "internal use only"
@@ -440,11 +440,11 @@ if [[ $state = plugins ]]; then
   typeset -ga ${plug}
   if zstyle -T ":completion:${curcontext}:plugins" verbose; then
     (( ${(P)#plugvar} )) || set -A ${plugvar} \
-        ${${(f)"$(_call_program plugins ansible-doc -t $plug -l)"}/ ##/:}
+        ${${${(f)"$(_call_program plugins ansible-doc -t $plug -l)"}:# *}/(:|) ##/:}
     _describe -t plugins "${plug} plugin" $plugvar -M 'r:|.=* r:|=*' && ret=0
   else
     (( ${(P)#plugvar} )) || set -A ${plugvar} \
-        ${${(f)"$(_call_program plugins ansible-doc -t $plug -F)"}%% *}
+        ${${(f)"$(_call_program plugins ansible-doc -t $plug -F)"}%%(|:) *}
     _wanted plugins expl "${plug} plugin" compadd -M 'r:|.=* r:|=*' -a $plugvar && ret=0
   fi
 fi