Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: pws-10: _arguments problem



Andrej Borsenkow wrote:

> With stock pws-10:
> 
> bor@itsrm2:/tools/src/imap-4.7%> gdiff -u src/os/u/env_u<TAB>
> _arguments:comparguments:166: not enough arguments

_use_lo called _arguments without the `--' needed and _arguments
didn't test if it got any arguments.

Bye
 Sven

diff -u -r oldcompletion/Base/_arguments Completion/Base/_arguments
--- oldcompletion/Base/_arguments	Fri Dec  3 15:08:14 1999
+++ Completion/Base/_arguments	Fri Dec  3 16:00:17 1999
@@ -71,6 +71,7 @@
     lopts=("--${(@)^${(@)${(@)${(@M)${(@ps:\n:j:\n:)${(@)${(@M)${(@f)$(${~words[1]} --help 2>&1)//\[--/
 --}:#[ 	]#-*}//,/
 }}:#[ 	]#--*}#*--}%%[], ]*}:#}")
+    lopts=( "${(@)lopts:#--}" )
 
     # Now remove all ignored options ...
 
@@ -163,7 +164,7 @@
 
 _style -s options auto-description autod
 
-if comparguments -i "$autod" "$@"; then
+if (( $# )) && comparguments -i "$autod" "$@"; then
   local nm="$compstate[nmatches]" action noargs aret expl local
   local next direct odirect equal single match matched ws tmp1 tmp2 tmp3
   local opts subc prefix suffix
diff -u -r oldcompletion/User/_use_lo Completion/User/_use_lo
--- oldcompletion/User/_use_lo	Fri Dec  3 15:08:31 1999
+++ Completion/User/_use_lo	Fri Dec  3 15:53:52 1999
@@ -3,4 +3,4 @@
 # This is for GNU-like commands which understand the --help option,
 # but which do not otherwise require special completion handling.
 
-_arguments || _default
+_arguments -- || _default

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author