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

Re: zsh make(1) completion on FreeBSD



Guilherme Salazar wrote on Tue, Oct 11, 2016 at 21:24:16 -0300:
> If one's make points to gmake instead of bmake, $words[1] itself will
> not be gmake. New patch attached fixes that, by looking for GNU in
> `$words[1] -v`. Sorry about that, didn't think about it before ;p

> --- /usr/ports/shells/zsh/work/zsh-5.2/Completion/Unix/Command/_make	2015-08-08 14:51:33.000000000 -0300
> +++ /usr/local/share/zsh/5.2/functions/Completion/Unix/_make	2016-10-11 21:15:56.295311000 -0300
> @@ -268,7 +268,14 @@
> +          if [[ `$words[1] -v 2> /dev/null` == *'GNU'* ]] 

That's precisely what the _pick_variant call at the top of the function
does, so you can just test $is_gnu instead.  Note that the enclosing if
already inspects that variable.

In current master (before your patch), the 'call-command' style is
consulted only for GNU make but not for FreeBSD.  Do you know if that's
intentional, perhaps (going by the style's docs) because the GNU make
invocation has side-effects while the BSD make invocation has none?



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