about summary refs log tree commit diff
path: root/Completion/Base
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-08-27 12:02:50 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-08-27 12:02:50 +0000
commit0161b1ca7752c4a768dd3dcf38493290b9d36ff7 (patch)
tree33d97420437bc1f8f4657c05c7f97af5eb76173b /Completion/Base
parent98de79a703a934d8e44d9019c006c8e8fad41005 (diff)
downloadzsh-0161b1ca7752c4a768dd3dcf38493290b9d36ff7.tar.gz
zsh-0161b1ca7752c4a768dd3dcf38493290b9d36ff7.tar.xz
zsh-0161b1ca7752c4a768dd3dcf38493290b9d36ff7.zip
zsh-workers/7515
Diffstat (limited to 'Completion/Base')
-rw-r--r--Completion/Base/_arguments26
1 files changed, 26 insertions, 0 deletions
diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments
index 60b07b2e4..5deef344b 100644
--- a/Completion/Base/_arguments
+++ b/Completion/Base/_arguments
@@ -533,8 +533,34 @@ else
     if [[ -z "$action" ]]; then
 
       # An empty action means that we should just display a message.
+
       _message "$descr"
       return ret
+
+    elif [[ "$action" = \(\(*\)\) ]]; then
+
+      # ((...)) contains literal strings with descriptions.
+
+      eval ws\=\( "${action[3,-3]}" \)
+
+      compadd -D ws - "${(@)ws%%:*}"
+
+      if (( $#ws )); then
+        beg=1
+        for nth in "$ws[@]"; do
+          tmp="${#nth%%:*}"
+	  [[ tmp -gt beg ]] && beg="$tmp"
+        done
+        tmp=''
+        for nth in "$ws[@]"; do
+          tmp="$tmp
+${(r:beg:: :)nth%%:*} -- ${nth#*:}"
+        done
+        tmp="$tmp[2,-1]"
+        compadd "$expl[@]" -y tmp - "${(@)ws%%:*}"
+      else
+        _message "$descr"
+      fi
     elif [[ "$action" = \(*\) ]]; then
 
       # Anything inside `(...)' is added directly.