From 5df8ef1e438e06dbd05368281640836adee88aa6 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Thu, 13 Mar 2003 09:59:48 +0000 Subject: 18347: fix problems with having more than one ((val\:desc ...)) style action --- Completion/Base/Utility/_alternative | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Completion') diff --git a/Completion/Base/Utility/_alternative b/Completion/Base/Utility/_alternative index 2f3e2dbc8..c7b71d9bc 100644 --- a/Completion/Base/Utility/_alternative +++ b/Completion/Base/Utility/_alternative @@ -1,7 +1,7 @@ #autoload local tags def expl descr action mesgs nm="$compstate[nmatches]" subopts -local opt curcontext="$curcontext" +local opt ws curcontext="$curcontext" subopts=() while getopts 'O:C:' opt; do @@ -33,13 +33,12 @@ while _tags; do mesgs=( "$mesgs[@]" "${def%%:*}:$descr") elif [[ "$action" = \(\(*\)\) ]]; then - local ws # ((...)) contains literal strings with descriptions. eval ws\=\( "${action[3,-3]}" \) - _describe "$descr" ws -M 'r:|[_-]=* r:|=*' "$subopts[@]" + _describe -t "${def%%:*}" "$descr" ws -M 'r:|[_-]=* r:|=*' "$subopts[@]" elif [[ "$action" = \(*\) ]]; then # Anything inside `(...)' is added directly. -- cgit 1.4.1