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

Re: Per command _redirect completion



 --- Felix Rosencrantz <f_rosencrantz@xxxxxxxxx> wrote:
> Below is a proposed change for the _redirect completion function.  If
> there
> is a function with the name _redirect:COMMAND, that function is
> called
> to perform completion.  Otherwise, the default behavior of completing
> files
> is performed.  This is the way we do variable specific dispatch for
> _value.
> 
> If there are no objections, I'll create a real diff and checkin.

I would prefer if - both for redirection and for values - we had
separate associative arrays like _comps. And then, perhaps a compdef
option for adding to these new associations.

This is for a number of reasons, one being consistency with the way we
handle commands.

Many of the _value: functions just call one other function. It'd be
better if instead, for example we could specify in the #compdef on
_x_display to handle the $DISPLAY variable. Also, in many cases what
should be completed is already being done in another function. For
example, $GZIP should complete gzip options. It'd be more useful to
direct this into _gzip where gzip options are already completed and
_gzip would just need a compstate test. 

This redirection suggestion is even more linked to the command being
run and again it would be more useful to use the existing command's
completion function and have it work out what sort of files to
complete.

Oliver



__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com



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