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

Re: Per command _redirect completion

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

> And one (mostly) unrelated remark: in a private mail Oliver asked if
> it were possible to supply the completion widgets with a list of
> redirections on the line. Collecting this information shouldn't be
> too
> complicated. Any suggestions for how we should pas this information
> to
> the completion function? An array containing values of the form
> `<redir-op>:<word>'?

The array sounds reasonable. What happens with something like 2>&1?
What can the redir op be - just < and > or a variety of things. What
about another command being piped to the one it is completing.

> diff -ur -r ../oz/Completion/Base/Utility/_contexts
> +# You may also select the assocs to use with the `-T assoc' option.

I know we only renamed it a year ago but _contexts perhaps could be
better named.

> diff -ur -r ../oz/Completion/Zsh/Context/_value_PRINTER
> ./Completion/Zsh/Context/_value_PRINTER
> @@ -0,0 +1,3 @@
> +#compdef -T values PRINTER LPDEST
> +
> +_printers

Do we really want lots of tiny little functions like this one? Can't we
just stick the compdef line in _printers itself. We have a compdef for
commands like rmdir in _directories which is a similar situation.

Have I also understood correctly, that the compdef changes allow
multiple uses of -T so that _gzip might start with:
    #compdef gzip gunzip gzcat=gunzip -T values GZIP

Sorry, but I've only had time to glance over this. I'll try it out and
reply more fully later.


Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts

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