Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] _find: Fix return value
- X-seq: zsh-workers 44675
- From: dana <dana@xxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: [PATCH] _find: Fix return value
- Date: Thu, 15 Aug 2019 15:56:23 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=EdqZflDIY6xsK1M1vnyacHhcIwuraI+E2zM3SFxgGLQ=; b=WOTUOzzNncxzbNA77L+IfaWfezBAbY2uJgEEwepNeD1zfFugalyVRpvR5udeYezukA QgQHAVnrXa/m4+8NGWgY86OxjC4wusRNFmWDInzioQa9ygahLh4fBu0ETmE1odXT0RVy KM26alW1l3ur+T1BsMtFJ2nIehg5eyuBsxouE1JeJMVl8kzMvCGNPgWp45m+wfT6J0bz 6M2QFEADUbhsdxdSQWOKwjpmeQna0XteCHL57ivykUqtYBdvPH/ifo5ppl1jdGV8OUHk kRFxFxF2GHNHBC+T8F8UTK+4iLwmRSwVP/NSW/dzSr0ws5H+gvUtlSK/CuKhDSnT/6OL FIUw==
- 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
I noticed that _find wasn't respecting my matcher styles (e.g., `find /a<TAB>`
wouldn't match /Applications), and it looks like it's because it erroneously
returns with 1 most of the time
dana
diff --git a/Completion/Unix/Command/_find b/Completion/Unix/Command/_find
index edd46ac1c..3b9150b17 100644
--- a/Completion/Unix/Command/_find
+++ b/Completion/Unix/Command/_find
@@ -1,6 +1,6 @@
#compdef find gfind
-local curcontext="$curcontext" state_descr variant default
+local curcontext="$curcontext" state_descr variant default ret=1
local -a state line args alts disp smatch
_pick_variant -r variant gnu=GNU $OSTYPE -version
@@ -147,7 +147,8 @@ _arguments -C $args \
'*-user:user:_users' \
'*-xdev' \
'*-a' '*-o' \
- '(-D -E -H -L -O -P -f -s -x --help --version)*:directory:_files -/'
+ '(-D -E -H -L -O -P -f -s -x --help --version)*:directory:_files -/' \
+&& ret=0
if [[ $state = times ]]; then
if ! compset -P '[+-]' || [[ -prefix '[0-9]' ]]; then
@@ -164,5 +165,7 @@ if [[ $state = times ]]; then
alts=( "senses:sense${default}:compadd -V times -S '' -d disp -a smatch" )
fi
alts+=( "times:${state_descr}:_dates -f d" )
- _alternative $alts
+ _alternative $alts && ret=0
fi
+
+return ret
Messages sorted by:
Reverse Date,
Date,
Thread,
Author