zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] make: return true if we added completions
@ 2011-04-14 22:34 Mikael Magnusson
  2011-04-15  8:35 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Mikael Magnusson @ 2011-04-14 22:34 UTC (permalink / raw)
  To: zsh workers

Does this look right?

---
 Completion/Unix/Command/_make |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/Completion/Unix/Command/_make b/Completion/Unix/Command/_make
index e404d16..1e62c0d 100644
--- a/Completion/Unix/Command/_make
+++ b/Completion/Unix/Command/_make
@@ -5,6 +5,7 @@
 
 local prev="$words[CURRENT-1]" file expl tmp is_gnu dir incl match
 local -A TARGETS VARIABLES
+local ret=1
 
 expandVars() {
   local open close var val front ret tmp=$1
@@ -159,10 +160,10 @@ fi
 
 if [[ "$prev" == -[CI] ]]
 then
-  _files -W ${(q)$(findBasedir ${words[1,CURRENT-1]})} -/
+  _files -W ${(q)$(findBasedir ${words[1,CURRENT-1]})} -/ && ret=0
 elif [[ "$prev" == -[foW] ]]
 then
-  _files -W ${(q)$(findBasedir $words)}
+  _files -W ${(q)$(findBasedir $words)} && ret=0
 else
   file="$words[(I)-f]"
   if (( file ))
@@ -208,15 +209,17 @@ else
     # Complete make variable as if shell variable
     compstate[parameter]="${PREFIX%%\=*}"
     compset -P 1 '*='
-    _value "$@"
+    _value "$@" && ret=0
   else
     _tags targets variables
     while _tags
     do
       _requested targets expl 'make targets' \
-        compadd -- ${(k)TARGETS}
+        compadd -- ${(k)TARGETS} && ret=0
       _requested variables expl 'make variables' \
-        compadd -S '=' -- ${(k)VARIABLES}
+        compadd -S '=' -- ${(k)VARIABLES} && ret=0
     done
   fi
 fi
+
+return ret
-- 
1.7.4-rc1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] make: return true if we added completions
  2011-04-14 22:34 [PATCH] make: return true if we added completions Mikael Magnusson
@ 2011-04-15  8:35 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2011-04-15  8:35 UTC (permalink / raw)
  To: zsh workers

On Fri, 15 Apr 2011 00:34:38 +0200
Mikael Magnusson <mikachu@gmail.com> wrote:
> Does this look right?

Looks reasonable to me.

-- 
Peter Stephenson <pws@csr.com>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-04-15  8:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-14 22:34 [PATCH] make: return true if we added completions Mikael Magnusson
2011-04-15  8:35 ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).