about summary refs log tree commit diff
path: root/Completion/Base/_arguments
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-08-20 07:49:07 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-08-20 07:49:07 +0000
commit780b7ae86edf032ee5343d2afc54cda0eb3a67f3 (patch)
tree65425aa1567ccfdd4698353dcfb97ad3331efb85 /Completion/Base/_arguments
parentc73034d147c0bc2c77bf10d15b0b12781d2b4e3f (diff)
downloadzsh-780b7ae86edf032ee5343d2afc54cda0eb3a67f3.tar.gz
zsh-780b7ae86edf032ee5343d2afc54cda0eb3a67f3.tar.xz
zsh-780b7ae86edf032ee5343d2afc54cda0eb3a67f3.zip
zsh-workers/7454
Diffstat (limited to 'Completion/Base/_arguments')
-rw-r--r--Completion/Base/_arguments21
1 files changed, 15 insertions, 6 deletions
diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments
index 5e0d35d44..9e9c4e892 100644
--- a/Completion/Base/_arguments
+++ b/Completion/Base/_arguments
@@ -3,7 +3,9 @@
 # Complete the arguments of the current command according to the
 # descriptions given as arguments to this function.
 
-local long args rest ws cur nth def nm expl descr action opt arg tmp
+setopt localoptions extendedglob
+
+local long args rest ws cur nth def nm expl descr action opt arg tmp ret=1
 
 # Associative arrays used to collect information about the options.
 
@@ -336,10 +338,17 @@ else
       # We aren't in an argument directly after a option name, so
       # all option names are possible matches.
 
-      _description expl option
-      compadd "$expl[@]" - "${(@k)opts}" "${(@k)mopts}" \
-                           "${(@k)dopts}" "${(@k)dmopts}" \
-			   "${(@k)odopts}" "${(@k)odmopts}"
+      if [[ "$compconfig[option_prefix]" != *(short|all)* ||
+            "$PREFIX" = -* ]]; then
+        _description expl option
+        compadd "$expl[@]" - "${(@k)opts}" "${(@k)mopts}" \
+                             "${(@k)dopts}" "${(@k)dmopts}" \
+			     "${(@k)odopts}" "${(@k)odmopts}" && ret=0
+      fi
+      [[ $#long -ne 0 &&
+         ( "$compconfig[option_prefix]" != *(long|all)* ||
+           "$PREFIX" = --* ) ]] && \
+          _long_options && ret=0
     fi
   fi
 
@@ -362,7 +371,7 @@ else
 
       # An empty action means that we should just display a message.
       _message "$descr"
-      return 1
+      return ret
     elif [[ "$action[1]" = \( ]]; then
 
       # Anything inside `(...)' is added directly.