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

Re: PATCH: Re: _arguments questions



Alexandre Duret-Lutz wrote:

> >>> "Sven" == Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx> writes:
> 
> ...
> 
>  Sven> Because of that (;-) and because it isn't quite the same (but I
>  Sven> confess, I had the same idea...). Especially, adding this dummy
>  Sven> element might be useful to combine with both `::' and `:::'.
> 
> An helper function ?
> 
>   _with_dummy_arg0 () {  #  I'm not good at finding names...
>        words=(dummy $words)
>        (( ++CURRENT ))
>        $@
>   }
> 
>   _arguments -a -b '-c:*::blah: _with_dummy_arg0 _arguments -c -d -e'

I thought about that, too. And then thought this could easily be put
in _arguments, i.e. make it just look for a certain prefix in the
action -- as if there were a function called. I couldn't find another
use for this dummy-insertion-function...

> Quite ugly, but looks understandable.  But taht way we can't get
> the 'parent' option (-c) for the dummy as you suggested.

We could. _arguments itself would probably use the same it puts into
$curcontext... (which in turn made me think that this wasn't so clever 
an idea anyway).

Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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