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

PATCH: _arguments (was Re: options are completed for non-option argument.)



Tanaka Akira wrote:

> Z(2):akr@flux% Src/zsh -f
> flux% bindkey -e; autoload -U compinit; compinit -D; compdef _tst tst       
> flux% _tst () {
> function> _arguments -s '-a' '-b' '-c' ':words:compadd - abyyy abzzz' 
> function> }
> flux% tst ab<TAB><TAB>
> -a   -c
> 
> Options are completed for non-option argument.

Oops. Problem with 12241, which should have fixed:

Wayne Davison wrote:

> I haven't had a chance to look into this yet, but if I type
> "perl -cw file<tab>" it won't complete the perl script.  I have
> to type "perl -c -w file<tab>", which is a pain.


Back to another message from Akira:

> Z(2):akr@flux% Src/zsh -f
> flux% bindkey -e; autoload -U compinit; compinit -D; compdef _tst tst
> flux% _tst () { _arguments '-e::*last:b:' }                          
> flux% tst -e <TAB>
> _arguments:294: command not found: b

The syntax is `-e:*last::message:action'.


Bye
 Sven

Index: Src/Zle/computil.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/computil.c,v
retrieving revision 1.37
diff -u -r1.37 computil.c
--- Src/Zle/computil.c	2000/07/13 11:04:00	1.37
+++ Src/Zle/computil.c	2000/07/17 07:49:13
@@ -1112,7 +1112,7 @@
 	    }
 	} else if (!p || (p && !p->active))
 	    return NULL;
-	pp = p;
+	pp = (p->name[0] == pre ? p : NULL);
 	p = NULL;
     }
     if (pp && end)

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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