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

Re: How to add completion: variant of "make" command



Kai Grossjohann wrote:
> So how do I make a variant of "make" completion that does what the
> shell script does before it invokes regular "make" completion?

You need to write your own make replacement and tell the shell to use
that.  Say it's called _make_with_xmake, then

  autoload -U _make_with_xmake
  compdef _make_with_xmake make

will do the trick.  If it's in the function path before _make and
contains the #compdef line below you shouldn't need to bother.

_make_with_xmake will probably look something like:


#compdef make

if <...test whether we want to do the xmake stuff...>; then
  <...do the xmake stuff...>
fi

_make "$@"


As long as it ends up with a call to the normal _make you can add
any preprocessing you like.  If you don't want to complete anything
special, you're pretty well insulated from the details of the
completion system.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php

To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview



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