about summary refs log tree commit diff
path: root/Completion/Zsh/Command/_which
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2003-06-25 09:03:04 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2003-06-25 09:03:04 +0000
commita267832ddf4150652fde3936858841bb2edbd9ae (patch)
tree961f0cbcaf8dbdaf2ff2e1a5409d644158f592bf /Completion/Zsh/Command/_which
parentdd54fb249881fa882319cd2642780dcebb8d9f7c (diff)
downloadzsh-a267832ddf4150652fde3936858841bb2edbd9ae.tar.gz
zsh-a267832ddf4150652fde3936858841bb2edbd9ae.tar.xz
zsh-a267832ddf4150652fde3936858841bb2edbd9ae.zip
18631: returning too early breaks prefix-needed style set to false
Diffstat (limited to 'Completion/Zsh/Command/_which')
-rw-r--r--Completion/Zsh/Command/_which14
1 files changed, 8 insertions, 6 deletions
diff --git a/Completion/Zsh/Command/_which b/Completion/Zsh/Command/_which
index 279475451..2b89112bc 100644
--- a/Completion/Zsh/Command/_which
+++ b/Completion/Zsh/Command/_which
@@ -1,6 +1,6 @@
 #compdef which whence where type
 
-local farg aarg cargs args state line curcontext="$curcontext"
+local farg aarg cargs args state line curcontext="$curcontext" ret=1
 
 cargs=( \
   '(-v -c)-w[print command type]' \
@@ -16,11 +16,11 @@ case ${service} in
     _arguments -C -s -A "-*" -S \
       '(-c -w)-v[verbose output]' \
       '(-v -w)-c[csh-like output]' \
-      "${cargs[@]}" "$farg" "$aarg" && return 0
+      "${cargs[@]}" "$farg" "$aarg" && ret=0
   ;;
-  where) _arguments -C -s -A "-*" -S "${cargs[@]}" && return 0;;
-  which) _arguments -C -s -A "-*" -S "${cargs[@]}" "$aarg" && return 0;;
-  type) _arguments -C -s -A "-*" -S "${cargs[@]}" "$aarg" "$farg" && return 0;;
+  where) _arguments -C -s -A "-*" -S "${cargs[@]}" && ret=0;;
+  which) _arguments -C -s -A "-*" -S "${cargs[@]}" "$aarg" && ret=0;;
+  type) _arguments -C -s -A "-*" -S "${cargs[@]}" "$aarg" "$farg" && ret=0;;
 esac
 
 if [[ "$state" = command ]]; then
@@ -32,6 +32,8 @@ if [[ "$state" = command ]]; then
     'builtins:builtin command:compadd -k builtins' \
     'functions:shell function:compadd -k functions' \
     'aliases:alias:compadd -k aliases' \
-    'reserved-words:reserved word:compadd -k reswords'
+    'reserved-words:reserved word:compadd -k reswords' && ret=0
 
 fi
+
+return ret