From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5265 invoked by alias); 24 Jun 2017 20:28:47 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 41358 Received: (qmail 26521 invoked from network); 24 Jun 2017 20:28:47 -0000 X-Qmail-Scanner-Diagnostics: from hahler.de by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(188.40.33.212):SA:0(0.0/5.0):. Processed in 1.425895 secs); 24 Jun 2017 20:28:47 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, RP_MATCHES_RCVD,SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: daniel@hahler.de X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.hahler.de designates 188.40.33.212 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=thequod.de; h= x-mailer:message-id:date:date:subject:subject:from:from:received :received:received; s=postfix2; t=1498336117; bh=a0Txj4/FP/lJZne Mb5GAmvtIbIrW9/Z8xksb53E+P0M=; b=SUr1FKf7ZOCe2GNrw3JIfawN21pj7Bg mdA0WH5E3x6tkev3a7I1+ieeVaz97Mi+axvEQF963fjadr8vb0/vfU+1tAyiwrqj N51KtHi6PtmBCoDYbObsL0mQkTcTifwpkkmrP5TIY1dV6HA7utf0tqaEGueVMILj epzkeLn3gAoM= From: Daniel Hahler To: zsh-workers@zsh.org Subject: [PATCH] Completion/Unix/Command/_make: whitespace/indent fixes Date: Sat, 24 Jun 2017 22:28:34 +0200 Message-Id: <20170624202834.8182-1-genml+zsh-workers@thequod.de> X-Mailer: git-send-email 2.13.1 From: Daniel Hahler --- Completion/Unix/Command/_make | 135 ++++++++++++++++++++---------------------- 1 file changed, 64 insertions(+), 71 deletions(-) diff --git a/Completion/Unix/Command/_make b/Completion/Unix/Command/_make index a2ee9ecac..274d296df 100644 --- a/Completion/Unix/Command/_make +++ b/Completion/Unix/Command/_make @@ -71,8 +71,7 @@ _make-expandVars() { _make-parseMakefile () { local input var val target dep TAB=$'\t' dir=$1 tmp IFS= - while read input - do + while read input; do case "$input " in # VARIABLE = value OR VARIABLE ?= value ([[:alnum:]][[:alnum:]_]#[" "$TAB]#(\?|)=*) @@ -125,8 +124,7 @@ _make-parseMakefile () { _make-findBasedir () { local file index basedir basedir=$PWD - for (( index=0; index < $#@; index++ )) - do + for (( index=0; index < $#@; index++ )); do if [[ $@[index] == -C ]] then file=${~@[index+1]} 2>/dev/null @@ -149,7 +147,6 @@ _make-findBasedir () { } _make() { - local prev="$words[CURRENT-1]" file expl tmp is_gnu dir incl match local context state state_descr line local -a option_specs @@ -219,83 +216,79 @@ _make() { case $state in (dir) - _description directories expl "$state_descr" - _files "$expl[@]" -W ${(q)$(_make-findBasedir ${words[1,CURRENT-1]})} -/ && ret=0 - ;; + _description directories expl "$state_descr" + _files "$expl[@]" -W ${(q)$(_make-findBasedir ${words[1,CURRENT-1]})} -/ && ret=0 + ;; (file) - _description files expl "$state_descr" - _files "$expl[@]" -W ${(q)$(_make-findBasedir $words)} && ret=0 - ;; + _description files expl "$state_descr" + _files "$expl[@]" -W ${(q)$(_make-findBasedir $words)} && ret=0 + ;; (debug) - _values -s , 'debug options' \ - '(b v i j m)a[all debugging output]' \ - 'b[basic debugging output]' \ - '(b)v[one level above basic]' \ - '(b)i[describe implicit rule searches (implies b)]' \ - 'j[show details on invocation of subcommands]' \ - 'm[enable debugging while remaking makefiles]' && ret=0 - ;; + _values -s , 'debug options' \ + '(b v i j m)a[all debugging output]' \ + 'b[basic debugging output]' \ + '(b)v[one level above basic]' \ + '(b)i[describe implicit rule searches (implies b)]' \ + 'j[show details on invocation of subcommands]' \ + 'm[enable debugging while remaking makefiles]' && ret=0 + ;; (target) - file=${(v)opt_args[(I)(-f|--file|--makefile)]} - if [[ -n $file ]] - then - [[ $file == [^/]* ]] && file=${(q)$(_make-findBasedir $words)}/$file - [[ -r $file ]] || file= - else - local basedir - basedir=${$(_make-findBasedir $words)} - if [[ $is_gnu == gnu && -r $basedir/GNUmakefile ]] - then - file=$basedir/GNUmakefile - elif [[ -r $basedir/makefile ]] - then - file=$basedir/makefile - elif [[ -r $basedir/Makefile ]] - then - file=$basedir/Makefile + file=${(v)opt_args[(I)(-f|--file|--makefile)]} + if [[ -n $file ]]; then + [[ $file == [^/]* ]] && file=${(q)$(_make-findBasedir $words)}/$file + [[ -r $file ]] || file= else - file='' + local basedir + basedir=${$(_make-findBasedir $words)} + if [[ $is_gnu == gnu && -r $basedir/GNUmakefile ]] + then + file=$basedir/GNUmakefile + elif [[ -r $basedir/makefile ]] + then + file=$basedir/makefile + elif [[ -r $basedir/Makefile ]] + then + file=$basedir/Makefile + else + file='' + fi fi - fi - if [[ -n "$file" ]] - then - if [[ $is_gnu == gnu ]] - then - if zstyle -t ":completion:${curcontext}:targets" call-command; then - _make-parseMakefile $PWD < <(_call_program targets "$words[1]" -nsp --no-print-directory -f "$file" .PHONY 2> /dev/null) - else - _make-parseMakefile $PWD < $file - fi - else - if [[ $OSTYPE == (freebsd|dragonfly|netbsd)* || /$words[1] == */bmake* ]]; then - TARGETS+=(${=${(f)"$(_call_program targets "$words[1]" -s -f "$file" -V.ALLTARGETS 2> /dev/null)"}}) - _make-parseMakefile $PWD < <(_call_program targets "$words[1]" -nsdg1Fstdout -f "$file" .PHONY 2> /dev/null) - else - _make-parseMakefile $PWD < $file - fi + if [[ -n "$file" ]]; then + if [[ $is_gnu == gnu ]]; then + if zstyle -t ":completion:${curcontext}:targets" call-command; then + _make-parseMakefile $PWD < <(_call_program targets "$words[1]" -nsp --no-print-directory -f "$file" .PHONY 2> /dev/null) + else + _make-parseMakefile $PWD < $file + fi + else + if [[ $OSTYPE == (freebsd|dragonfly|netbsd)* || /$words[1] == */bmake* ]]; then + TARGETS+=(${=${(f)"$(_call_program targets "$words[1]" -s -f "$file" -V.ALLTARGETS 2> /dev/null)"}}) + _make-parseMakefile $PWD < <(_call_program targets "$words[1]" -nsdg1Fstdout -f "$file" .PHONY 2> /dev/null) + else + _make-parseMakefile $PWD < $file + fi + fi fi - fi - if [[ $PREFIX == *'='* ]] - then - # Complete make variable as if shell variable - compstate[parameter]="${PREFIX%%\=*}" - compset -P 1 '*=' - _value "$@" && ret=0 - else - _tags targets variables - while _tags - do - _requested targets expl 'make targets' \ - compadd -Q -- $TARGETS && ret=0 - _requested variables expl 'make variables' \ - compadd -S '=' -F keys -- ${(k)VARIABLES} && ret=0 - done - fi + if [[ $PREFIX == *'='* ]]; then + # Complete make variable as if shell variable + compstate[parameter]="${PREFIX%%\=*}" + compset -P 1 '*=' + _value "$@" && ret=0 + else + _tags targets variables + while _tags + do + _requested targets expl 'make targets' \ + compadd -Q -- $TARGETS && ret=0 + _requested variables expl 'make variables' \ + compadd -S '=' -F keys -- ${(k)VARIABLES} && ret=0 + done + fi esac return ret -- 2.13.1