about summary refs log tree commit diff
path: root/Completion/Unix
diff options
context:
space:
mode:
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