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

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



Peter Stephenson <pws@xxxxxxx> writes:

> 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.[...] As long as it ends up with a call to the normal _make
> you can add any preprocessing you like.

Cool.  I ended up with the following in my ~/.zshrc:

_xmake () {
    if [ -r ./ENV ]; then
        . ./ENV
    fi
    _make "$@"
}
compdef _xmake xmake

It seemed to be too small to put it anywhere else :-)  Amazingly
enough, I already had a function and a compdef call; I just hadn't
thought that I could just call the existing function _make...  D'oh.

Thanks a lot!

Kai




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