Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] _make: target: handle "make -C dir"
- X-seq: zsh-workers 44695
- From: Daniel Hahler <genml+zsh-workers@xxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] _make: target: handle "make -C dir"
- Date: Thu, 22 Aug 2019 08:37:53 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=thequod.de; h= content-transfer-encoding:mime-version:x-mailer:message-id:date :date:subject:subject:from:from:received:received:received; s= postfix2; t=1566455879; bh=mt69h6/k3SXjzM8EBF5IWB8VNeOZ1W39LU1bJ UsQuRY=; b=uKOE14qxNdFBC3ZW3r7kYHRLsI9Ig+o/uCujlrBLY8geuGV34tSYx dYvLY+QW1FGZeeora/149e2WMPkh/qfWe0TppGtli27C4fFFxjvM3YFrqPHMCC8i 3bDOjV4xGDx2981PEifiAHgwtMPTLnHop9wpPujiF479upTpT1NQYw=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
From: Daniel Hahler <git@xxxxxxxxxx>
_make-findBasedir handles any "-C" arguments to find the basedir, but
with `zstyle -t :completion::complete:make::targets call-command true`
it would then not use it.
This is necessary however to get the correct list of targets, which
might be generated based on files from there.
`$basedir` defaults to `$PWD`, so it is ok to pass it always (I assume).
---
Completion/Unix/Command/_make | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/Completion/Unix/Command/_make b/Completion/Unix/Command/_make
index e23906373..38d0b0e76 100644
--- a/Completion/Unix/Command/_make
+++ b/Completion/Unix/Command/_make
@@ -236,13 +236,13 @@ _make() {
(target)
file=${(v)opt_args[(I)(-f|--file|--makefile)]}
+ local basedir
+ basedir=${$(_make-findBasedir $words)}
if [[ -n $file ]]
then
- [[ $file == [^/]* ]] && file=${(q)$(_make-findBasedir $words)}/$file
+ [[ $file == [^/]* ]] && file=$basedir/$file
[[ -r $file ]] || file=
else
- local basedir
- basedir=${$(_make-findBasedir $words)}
if [[ $is_gnu == gnu && -r $basedir/GNUmakefile ]]
then
file=$basedir/GNUmakefile
@@ -259,10 +259,10 @@ _make() {
if [[ -n "$file" ]]
then
- if [[ $is_gnu == gnu ]]
+ if [[ $is_gnu == gnu ]]
then
if zstyle -t ":completion:${curcontext}:targets" call-command; then
- _make-parseMakefile < <(_call_program targets "$words[1]" -nsp --no-print-directory -f "$file" .PHONY 2> /dev/null)
+ _make-parseMakefile < <(_call_program targets "$words[1]" -C $basedir -nsp --no-print-directory -f "$file" .PHONY 2> /dev/null)
else
_make-parseMakefile < $file
fi
--
2.23.0
Messages sorted by:
Reverse Date,
Date,
Thread,
Author