diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-04-11 07:57:56 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-04-11 07:57:56 +0000 |
commit | fac3086d9782e73dcaf1aa65fd36a0b63a374719 (patch) | |
tree | 7bab35e2787ca17f02ec932dffae1bfff2ffcfe3 /Completion/Base/_describe | |
parent | 37012f06a7e5e8a64614dbf9032c77cff1bcfcfb (diff) | |
download | zsh-fac3086d9782e73dcaf1aa65fd36a0b63a374719.tar.gz zsh-fac3086d9782e73dcaf1aa65fd36a0b63a374719.tar.xz zsh-fac3086d9782e73dcaf1aa65fd36a0b63a374719.zip |
_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)
Diffstat (limited to 'Completion/Base/_describe')
-rw-r--r-- | Completion/Base/_describe | 45 |
1 files changed, 24 insertions, 21 deletions
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 |