Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: _make: namespace internal functions
- X-seq: zsh-workers 29051
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: PATCH: _make: namespace internal functions
- Date: Tue, 26 Apr 2011 08:29:28 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:message-id:x-mailer; bh=moiIEyF+9PLGuxsllRDllO+d0FEW166lkpSNjhu+1bk=; b=oewn08n02HTuVnN29Tk49kMBpHu/NUJnJTJK1vkYXBFdw75BQ9DkGLkDc9e18iv/Ti qK1o+dMCjM3jlxZa6f1QiCoZt9QGHU8iHokqGuYR+3fdFGPnx0ZlpxbT4+ZIfnsX0Lf6 sLXF4DcjhxNE6iSBPxyGk3xShRHaDfAQVJm+M=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:x-mailer; b=QOi6wXkhMD2ZvFsnOyB8xNum+vzXLqoXtqp266vIiRu7XAM95osAJU89nLJaGRuifZ vJU08PVcS9NR/kMxSLa1rYXbPpdCUSHx+dKOo0jwU6zv/EDWF2NoUjIinBvoNWLW/8WE H6TDtrUsNRWL50kCOXOQFKw18DIagxcwGAtn4=
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
---
Completion/Unix/Command/_make | 32 ++++++++++++++++----------------
1 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/Completion/Unix/Command/_make b/Completion/Unix/Command/_make
index 1e62c0d..322414b 100644
--- a/Completion/Unix/Command/_make
+++ b/Completion/Unix/Command/_make
@@ -7,7 +7,7 @@ local prev="$words[CURRENT-1]" file expl tmp is_gnu dir incl match
local -A TARGETS VARIABLES
local ret=1
-expandVars() {
+_make-expandVars() {
local open close var val front ret tmp=$1
front=${tmp%%\$*}
@@ -29,7 +29,7 @@ expandVars() {
;;
(\$*) # Escaped $.
- print -- "${front}\$$(expandVars ${tmp#\$})"
+ print -- "${front}\$$(_make-expandVars ${tmp#\$})"
return
;;
@@ -59,10 +59,10 @@ expandVars() {
;;
esac
- print -- "${front}$(expandVars ${ret})"
+ print -- "${front}$(_make-expandVars ${ret})"
}
-parseMakefile () {
+_make-parseMakefile () {
local input var val target dep TAB=$'\t' dir=$1 tmp
while read input
@@ -82,14 +82,14 @@ parseMakefile () {
var=${input%%[ $TAB]#:=*}
val=${input#*=}
val=${val##[ $TAB]#}
- val=$(expandVars $val)
+ val=$(_make-expandVars $val)
VARIABLES[$var]=$val
;;
# TARGET: dependencies
# TARGET1 TARGET2 TARGET3: dependencies
([[:alnum:]][^$TAB:=]#:[^=]*)
- input=$(expandVars $input)
+ input=$(_make-expandVars $input)
target=${input%%:*}
dep=${input#*:}
dep=${(z)dep}
@@ -108,7 +108,7 @@ parseMakefile () {
f=${f#[\"<]}
f=${f%[\">]}
fi
- f=$(expandVars $f)
+ f=$(_make-expandVars $f)
case $f in
(/*) ;;
(*) f=$dir/$f ;;
@@ -116,14 +116,14 @@ parseMakefile () {
if [[ -r $f ]]
then
- parseMakefile ${f%%/[^/]##} < $f
+ _make-parseMakefile ${f%%/[^/]##} < $f
fi
;;
esac
done
}
-findBasedir () {
+_make-findBasedir () {
local file index basedir
basedir=$PWD
for (( index=0; index < $#@; index++ ))
@@ -160,20 +160,20 @@ fi
if [[ "$prev" == -[CI] ]]
then
- _files -W ${(q)$(findBasedir ${words[1,CURRENT-1]})} -/ && ret=0
+ _files -W ${(q)$(_make-findBasedir ${words[1,CURRENT-1]})} -/ && ret=0
elif [[ "$prev" == -[foW] ]]
then
- _files -W ${(q)$(findBasedir $words)} && ret=0
+ _files -W ${(q)$(_make-findBasedir $words)} && ret=0
else
file="$words[(I)-f]"
if (( file ))
then
file=${~words[file+1]}
- [[ $file == [^/]* ]] && file=${(q)$(findBasedir $words)}/$file
+ [[ $file == [^/]* ]] && file=${(q)$(_make-findBasedir $words)}/$file
[[ -r $file ]] || file=
else
local basedir
- basedir=${(q)$(findBasedir $words)}
+ basedir=${(q)$(_make-findBasedir $words)}
if [[ $is_gnu == gnu && -r $basedir/GNUmakefile ]]
then
file=$basedir/GNUmakefile
@@ -192,14 +192,14 @@ else
then
if [[ $is_gnu == gnu ]] && zstyle -t ":completion:${curcontext}:targets" call-command
then
- parseMakefile $PWD < <(_call_program targets "$words[1]" -nsp --no-print-directory -f "$file" .PHONY 2> /dev/null)
+ _make-parseMakefile $PWD < <(_call_program targets "$words[1]" -nsp --no-print-directory -f "$file" .PHONY 2> /dev/null)
else
case "$OSTYPE" in
freebsd*)
- parseMakefile $PWD < <(_call_program targets "$words[1]" -nsp -f "$file" .PHONY 2> /dev/null)
+ _make-parseMakefile $PWD < <(_call_program targets "$words[1]" -nsp -f "$file" .PHONY 2> /dev/null)
;;
*)
- parseMakefile $PWD < $file
+ _make-parseMakefile $PWD < $file
esac
fi
fi
--
1.7.4-rc1
Messages sorted by:
Reverse Date,
Date,
Thread,
Author