From 2461beb0acabd70398eaf9876e4456e82c75013e Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 5 Jun 2007 10:34:08 +0000 Subject: unposted: more _units tweaks --- Completion/Unix/Command/_units | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Completion') 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 -- cgit 1.4.1