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

Re: problem with _arguments exclusion lists



--- Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> Ok, here's my suggestion.  The option's name is `-w', dunno if we
> should
> exchange the meaning of -W and -w (-w is the stronger one, so to
> say).

Yes, we probably should swap them.

> Then I suggest to use the following as the pattern-match utility

Looks good. I thought the description might be more complicated than
just using -X.

>   [[ -n "$PREFIX$SUFFIX" ]] 

I'm not sure about this line at the end. It is not a likely option name
but, using the usual example, this would prevent a -c0nf option being
completed from -c0<tab>. In what sort of case did you see it as being
useful?

> It might be called as in:
>   _arguments  -s '(-conf)-c+:numeric value:prop "[0-9]#"' '-conf'
> '-f'

Testing this, I get what I thought was -w behaviour only: -c<tab>
offers:
  numeric value
  option
  -conf   -f
I thought that it was only going to offer -f if _arguments was passed
the -w option.

> That feels quite satisfying.

It's great. Thanks Sven.

> So, if anyway can tell me a good name for that utility function, I'm
> going to commit it.  I really don't have the faintest idea.  Oliver?

I didn't have much in mind. The best I can think of is _guard. I'd
prefer something short because it will be most used in the generally
long _arguments specs so I'm not too keen on something like
_messsage_guarded. Other ideas are _block, _pattern, _failpat.

Oliver

____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie



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