about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-08-20 23:24:11 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-08-20 23:24:11 +0000
commit115a26274eaa536a7e8a21f6a7f9572adbbcc7ef (patch)
tree1cafcda64b2704cf0a98d1f6093effed766f9823 /Completion
parentbcd214d5ba3990cdc417762370c2911b3407bf31 (diff)
downloadzsh-115a26274eaa536a7e8a21f6a7f9572adbbcc7ef.tar.gz
zsh-115a26274eaa536a7e8a21f6a7f9572adbbcc7ef.tar.xz
zsh-115a26274eaa536a7e8a21f6a7f9572adbbcc7ef.zip
zsh-workers/7458
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Base/_arguments6
-rw-r--r--Completion/Base/_long_options4
2 files changed, 6 insertions, 4 deletions
diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments
index 4341a9c81..1c5fa7a1d 100644
--- a/Completion/Base/_arguments
+++ b/Completion/Base/_arguments
@@ -158,12 +158,12 @@ else
       else
         uns=''
         if [[ -n "$single" && "$ws[1]" = [-+]* ]]; then
-          if [[ $#opts -ne 0 &&
+          if [[ ${#${(kj::)opts[(R)?*]#?}} -ne 0 &&
                 "$ws[1]" = ${ws[1][1]}*[${(kj::)opts[(R)?*]#?}] ]]; then
 	    def="$opts[${ws[1][1]}${ws[1][-1]}]"
 	    uns="${ws[1][2,-1]}"
 	    opt=''
-	  elif [[ $#mopts -ne 0 &&
+	  elif [[ ${#${(kj::)mopts[(R)?*]#?}} -ne 0 &&
                   "$ws[1]" = ${ws[1][1]}*[${(kj::)mopts[(R)?*]#?}] ]]; then
 	    def="$mopts[${ws[1][1]}${ws[1][-1]}]"
 	    uns="${ws[1][2,-1]}"
@@ -457,7 +457,7 @@ else
       [[ $#long -ne 0 &&
          ( "$compconfig[option_prefix]" != *(long|all)* ||
            "$PREFIX" = --* ) ]] && \
-          _long_options && ret=0
+	  _long_options "$long[@]" && ret=0
     fi
   fi
 
diff --git a/Completion/Base/_long_options b/Completion/Base/_long_options
index 461da893c..0080a48b6 100644
--- a/Completion/Base/_long_options
+++ b/Completion/Base/_long_options
@@ -135,7 +135,7 @@ if [[ "$tmp" != $_lo_cache_cmd ]]; then
 
   set -- "$@" '*=FILE*:file:_files' '*=(DIR|PATH)*:directory:_files -/' '*:unknown:'
 
-  while [[ $# -gt 1 ]]; do
+  while [[ $# -gt 0 ]]; do
 
     # First, we get the pattern and the action to use and take them
     # from the positional parameters.
@@ -265,6 +265,8 @@ if [[ "$str" = *\=* ]]; then
 	  action=($=action)
 	  ${(e)action[1]} "$expl[@]" ${(e)~action[2,-1]}
         fi
+      else
+        _message "$descr"
       fi
 
       # We found the option string, return.