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

Re: zsh make(1) completion on FreeBSD



> The correct way to quote $words[1] would have been «${(q)words[1]}», but
> elements of $words are already command-line quoted so they don't need to
> be quoted again.  That is: just using $words[1] directly would be correct.
> (modulo noglob, but don't worry about that)

Thank you for the explanation.

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 @@
       else
         case "$OSTYPE" in
           freebsd*)
-          _make-parseMakefile $PWD < <(_call_program targets "$words[1]" -nsp -f "$file" .PHONY 2> /dev/null)
+          if [[ `$words[1] -v 2> /dev/null` == *'GNU'* ]] 
+          then
+            args="-nsp"
+          else
+            args="-nsdg1Fstdout"
+            TARGETS+=(${=${(f)"$(_call_program targets \"$words[1]\" -s -f "$file" -V.ALLTARGETS 2> /dev/null)"}})
+          fi
+          _make-parseMakefile $PWD < <(_call_program targets "$words[1]" $args -f "$file" .PHONY 2> /dev/null)
     ;;
     *)
           _make-parseMakefile $PWD < $file


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