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

Re: problem with _arguments exclusion lists



--- Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx> wrote:

> >   _arguments -s '(-conf)-c+:val' '-conf' '-f'
> > after -c, it completes with the 'val' message so even after -co, it
> > can't complete -conf. I found these problems with _pine which
> > completes a number after -c.
 
> Yes, i was aware of that.  The problem is that some programs would
> not
> continue parsing `-c...' as a possible option, while some would.  I
> think I would call such programs `well-behaved'.

I think you've misunderstood me here. Are you thinking of the case
where, for the _arguments example above some programs maybe allow the
`f' option after -c as `-cf3' to mean the same as `-c3 -f'?

In a case such as _pine, after `-c', there can either be a number which
is an argument to the -c option or it could go on to complete an option
with a longer name such as -conf, -character-set etc. At the moment, it
fails to complete the latter and it should do. This was the intended
gist of my last message.

> > Maybe there would be a use here for a basic
> > completion for numbers so that it can know that -co can not be -c
> with
> > a parameter.

What I was basically getting at there is something along the lines of
[[ $PREFIX$SUFFIX = [0-9]* ]] && _message 'number'
so that after -co, it could see that the `o' doesn't match [0-9]* and
would only complete further options (such as -conf).

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