about summary refs log tree commit diff
path: root/Completion/Unix
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2007-06-05 10:34:08 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2007-06-05 10:34:08 +0000
commit2461beb0acabd70398eaf9876e4456e82c75013e (patch)
tree88ca87a87ea18a31b75e27e04d4f09e028db5a82 /Completion/Unix
parent83bf1b5c995be69e729871a65696ae1248b9f8e5 (diff)
downloadzsh-2461beb0acabd70398eaf9876e4456e82c75013e.tar.gz
zsh-2461beb0acabd70398eaf9876e4456e82c75013e.tar.xz
zsh-2461beb0acabd70398eaf9876e4456e82c75013e.zip
unposted: more _units tweaks
Diffstat (limited to 'Completion/Unix')
-rw-r--r--Completion/Unix/Command/_units8
1 files changed, 5 insertions, 3 deletions
diff --git a/Completion/Unix/Command/_units b/Completion/Unix/Command/_units
index 357211642..d6bc6987f 100644
--- a/Completion/Unix/Command/_units
+++ b/Completion/Unix/Command/_units
@@ -1,6 +1,7 @@
 #compdef units
 
 local curcontext="$curcontext" state line
+integer ret=1
 typeset -A opt_args
 
 # Command line completion for Solaris units isn't very useful; this
@@ -67,12 +68,13 @@ pfxs=(${${all:#^[[:alnum:]]##-}%%-})
 units=(${${all:#^[[:alnum:]]##([\(\]]*|)}%%\(*})
 
 if (( ${#units} )); then
-  _alternative 'unit prefixes:unitprefix:compadd -S "" -a pfxs' \
-    'units:unit:compadd -a units' && return 0
+  _alternative 'unitprefixes:unit prefix:compadd -S "" -a pfxs' \
+    'units:unit:compadd -a units' && ret=0
   # attempt to skip a prefix
   if compset -P "(${(j.|.)pfxs})"; then
-    _wanted units expl unit compadd -a units
+    _wanted units expl unit compadd -a units && ret=0
   fi
+  return ret
 else
   _message "No unit definitions found."
 fi