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

Re: Cygwin Zsh auto-cygpath?



On Mon, 9 Feb 2009, Peter Stephenson wrote:

"Benjamin R. Haskell" wrote:
I was wondering if there was a simple way to have the _files completer
output "$(cygpath -w /path/stuff)".

Completely replacing the output of a completion functions may be doable
though is likely to be icky, but note that if you define a function

 cyg() {
   reply=("$(cygpath -w $REPLY)")
 }

in a recent version of the shell then you can put "(+cyg)" (minus quotes, with parentheses---it's a glob qualifer) after any file name to convert it.

Oooh. Very cool. I like that. And, it's probably what I'll stick with.

But as a followup, and not necessarily for only this situation...

How hard is it to extend csh-style modifiers -- to do, e.g. $param:+cyg ?

Thanks,
Ben



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