summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--Completion/Unix/Command/_units8
2 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 0734a9cf3..ebc1347eb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2007-06-05  Peter Stephenson  <pws@csr.com>
 
+	* unposted: Completion/Unix/Command/_units: message and tag were
+	reversed; always attempt completion with removed prefix
+	(a bit problematic if prefix is e.g. "m").
+
 	* From Mikael Magnusson and Phil Pennock: 23521, 23522:
 	Completion/Unix/Command/_units: extra locations for
 	units data.
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