From fac3086d9782e73dcaf1aa65fd36a0b63a374719 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Tue, 11 Apr 2000 07:57:56 +0000 Subject: _wanted now tests both tags and labels; change places where _wanted was called without a command; allow multiple patterns per string in file-patterns; update _next_tags to work with labels (10632) --- Completion/Base/_describe | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) (limited to 'Completion/Base/_describe') diff --git a/Completion/Base/_describe b/Completion/Base/_describe index 6e6f4f4a9..ca2d3e4cf 100644 --- a/Completion/Base/_describe +++ b/Completion/Base/_describe @@ -14,8 +14,6 @@ fi # Do the tests. `showd' is set if the descriptions should be shown. -_wanted "$_type" || return 1 - zstyle -T ":completion:${curcontext}:$_type" verbose && _showd=yes _descr="$1" @@ -24,30 +22,35 @@ shift [[ "$_type" = options ]] && zstyle -t ":completion:${curcontext}:options" prefix-hidden && _hide=yes -while _next_label "$_type" _expl "$_descr"; do +_tags "$_type" +while _tags; do + while _next_label "$_type" _expl "$_descr"; do - if [[ -n "$_showd" ]]; then - compdescribe -I ' -- ' "$@" - else - compdescribe -i "$@" - fi + if [[ -n "$_showd" ]]; then + compdescribe -I ' -- ' "$@" + else + compdescribe -i "$@" + fi - while compdescribe -g _args _tmpd _tmpmd _tmps _tmpms; do + while compdescribe -g _args _tmpd _tmpmd _tmps _tmpms; do - # See if we should remove the option prefix characters. + # See if we should remove the option prefix characters. - if [[ -n "$_hide" ]]; then - if [[ "$PREFIX" = --* ]]; then - _tmpd=( "${(@)_tmpd#--}" ) - _tmps=( "${(@)_tmps#--}" ) - elif [[ "$PREFIX" = [-+]* ]]; then - _tmpd=( "${(@)_tmpd#[-+]}" ) - _tmps=( "${(@)_tmps#[-+]}" ) + if [[ -n "$_hide" ]]; then + if [[ "$PREFIX" = --* ]]; then + _tmpd=( "${(@)_tmpd#--}" ) + _tmps=( "${(@)_tmps#--}" ) + elif [[ "$PREFIX" = [-+]* ]]; then + _tmpd=( "${(@)_tmpd#[-+]}" ) + _tmps=( "${(@)_tmps#[-+]}" ) + fi fi - fi - compadd "$_args[@]" "$_expl[@]" -ld _tmpd - "$_tmpmd[@]" && _ret=0 - compadd "$_args[@]" "$_expl[@]" -d _tmps - "$_tmpms[@]" && _ret=0 + compadd "$_args[@]" "$_expl[@]" -ld _tmpd - "$_tmpmd[@]" && _ret=0 + compadd "$_args[@]" "$_expl[@]" -d _tmps - "$_tmpms[@]" && _ret=0 + done done + (( _ret )) || return 0 done -return _ret + +return 1 -- cgit v1.3.1