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

Re: rake completion with colons in their names

On Sun, 22 Apr 2012 16:50:03 +0200
Benoit Daloze <eregontp@xxxxxxxxx> wrote:
> > It might be sensible to turn that target completion into a separate
> > function as a first step to make it clearer what's going on.
> How would you do that? Do you mean wrapping it in a function?

No, I mean turning this rather baroque expression that creates the array
"target" (and that I can't follow as it stands without detailed

${${(f)"$(_call_program targets $words[1] -sT $opt_args[(I)(-N|--nosearch)] ${(kv)opt_args[(I)(-f|--rakefile)]} 2>/dev/null)"}/(#b)rake ([^ ]##) ##\# (*)/${${match[1]}//:/\\:}:${match[2]:l}}

into a function that assembles the completion.  That might at least make
it obvious what's going on.

However, it might be worth seeing if replacing _describe as the function
to add the completions (just below that expression) helps.  _describe
treats colons specially, and although the colons are being quoted with
backslashes in the expression above, I wouldn't be 100% sure this
actually has the right effect.

Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/

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