diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2007-06-05 10:34:08 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2007-06-05 10:34:08 +0000 |
commit | 2461beb0acabd70398eaf9876e4456e82c75013e (patch) | |
tree | 88ca87a87ea18a31b75e27e04d4f09e028db5a82 | |
parent | 83bf1b5c995be69e729871a65696ae1248b9f8e5 (diff) | |
download | zsh-2461beb0acabd70398eaf9876e4456e82c75013e.tar.gz zsh-2461beb0acabd70398eaf9876e4456e82c75013e.tar.xz zsh-2461beb0acabd70398eaf9876e4456e82c75013e.zip |
unposted: more _units tweaks
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | Completion/Unix/Command/_units | 8 |
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 |