about summary refs log tree commit diff
path: root/Completion/Base/_arguments
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-11-09 13:14:59 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-11-09 13:14:59 +0000
commitc615397157e5efd7a81c8ce11b3f77fd7ccb5a19 (patch)
tree9f6e9081024370574ae18b5808ebedf6d653d672 /Completion/Base/_arguments
parent95af0ef9c4639763c8094d6e8cd5d8ec01a32f96 (diff)
downloadzsh-c615397157e5efd7a81c8ce11b3f77fd7ccb5a19.tar.gz
zsh-c615397157e5efd7a81c8ce11b3f77fd7ccb5a19.tar.xz
zsh-c615397157e5efd7a81c8ce11b3f77fd7ccb5a19.zip
zsh-workers/8603
Diffstat (limited to 'Completion/Base/_arguments')
-rw-r--r--Completion/Base/_arguments26
1 files changed, 13 insertions, 13 deletions
diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments
index 31713750f..68b52eef4 100644
--- a/Completion/Base/_arguments
+++ b/Completion/Base/_arguments
@@ -154,14 +154,14 @@ fi
 if comparguments -i "$compconfig[autodescribe_options]" "$@"; then
   local nm="$compstate[nmatches]" action noargs aret expl local
   local next direct odirect equal single match matched ws tmp1 tmp2
-  local tags opts
+  local opts
 
   if comparguments -D descr action; then
     if comparguments -O next direct odirect equal; then
       opts=yes
-      _tags -f "$funcstack[2]" argument option
+      _tags argument option
     else
-      _tags -f "$funcstack[2]" argument
+      _tags argument
     fi
   else
     if comparguments -a; then
@@ -172,12 +172,12 @@ if comparguments -i "$compconfig[autodescribe_options]" "$@"; then
     comparguments -O next direct odirect equal || return 1
 
     opts=yes
-    _tags -f "$funcstack[2]" option
+    _tags option
   fi
 
   while _tags; do
     while true; do
-      if [[ "$tags" = *:argument* ]]; then
+      if [[ -n "$matched" ]] || _requested argument; then
         _description expl "$descr"
 
         if [[ "$action" = -\>* ]]; then
@@ -207,7 +207,7 @@ if comparguments -i "$compconfig[autodescribe_options]" "$@"; then
 
             eval ws\=\( "${action[3,-3]}" \)
 
-            _describe -c "$cmd" -f "$funcstack[2]" "$descr" ws -M "$match"
+            _describe -c "$cmd" "$descr" ws -M "$match"
 
           elif [[ "$action" = \(*\) ]]; then
 
@@ -234,8 +234,8 @@ if comparguments -i "$compconfig[autodescribe_options]" "$@"; then
           fi
         fi
       fi
-      if [[ "$tags" = *:option* &&
-            ( "$tags" != *\[*prefix*\]* || "$PREFIX" = [-+]* ) ]]; then
+      if [[ -z "$matched" ]] && _requested option &&
+          { ! _style option prefix || [[ "$PREFIX" = [-+]* ]] } ; then
         comparguments -M match
 
         if comparguments -s single; then
@@ -253,20 +253,21 @@ if comparguments -i "$compconfig[autodescribe_options]" "$@"; then
 	    tmp1=( "${(M@)tmp1:#[-+]?(|:*)}" )
 	    tmp2=( "${PREFIX}${(@M)^${(@)${(@)tmp1%%:*}#[-+]}:#?}" )
 
-            _describe -o -c "$cmd" -f "$funcstack[2]" option \
+            _describe -o -c "$cmd" option \
                       tmp1 tmp2 -Q -S ''
           fi
           single=yes
         else
           next=( "$next[@]" "$odirect[@]" )
-          _describe -o -c "$cmd" -f "$funcstack[2]" option \
+          _describe -o -c "$cmd" option \
             next -Q -M "$match" -- \
             direct -QS '' -M "$match" -- \
             equal -QqS= -M "$match"
         fi
       fi
-      if [[ -n "$opts" && -z "$aret$matched" && nm -ne compstate[nmatches] &&
-            "$tags" = *:argument* ]]; then
+      if [[ -n "$opts" && -z "$aret$matched" &&
+            nm -ne compstate[nmatches] ]] &&
+          _requested argument; then
 
         local prefix suffix
 
@@ -282,7 +283,6 @@ if comparguments -i "$compconfig[autodescribe_options]" "$@"; then
 	  IPREFIX="${IPREFIX}${equal[1]%%:*}="
 	  matched=yes
 	  comparguments -L "$equal[1]" descr action
-	  tags=argument
 	  continue
         fi
       fi