diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 2000-03-23 04:19:26 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 2000-03-23 04:19:26 +0000 |
commit | 626e2aeb1657f112feb6d03c34bb9e9f44764c75 (patch) | |
tree | 9e4a306df7b5826a796b99f0b6ffa3423ee9f5f9 /Completion/Base/_describe | |
parent | 766fcd5ee2ef632cd982a1ec118dbdfde17c03a8 (diff) | |
download | zsh-626e2aeb1657f112feb6d03c34bb9e9f44764c75.tar.gz zsh-626e2aeb1657f112feb6d03c34bb9e9f44764c75.tar.xz zsh-626e2aeb1657f112feb6d03c34bb9e9f44764c75.zip |
zsh-workers/10195
Diffstat (limited to 'Completion/Base/_describe')
-rw-r--r-- | Completion/Base/_describe | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/Completion/Base/_describe b/Completion/Base/_describe index 986d27c4e..95016fcd1 100644 --- a/Completion/Base/_describe +++ b/Completion/Base/_describe @@ -3,7 +3,7 @@ # This can be used to add options or values with descriptions as matches. local _opt _expl _tmps _tmpd _tmpmd _tmpms _ret=1 _showd _nm _hide _args -local _type=values +local _type=values _descr # Get the option. @@ -14,37 +14,40 @@ fi # Do the tests. `showd' is set if the descriptions should be shown. -_tags "$_type" || return 1 +_wanted "$_type" || return 1 zstyle -T ":completion:${curcontext}:$_type" verbose && _showd=yes -_description "$_type" _expl "$1" +_descr="$1" shift -if [[ -n "$_showd" ]]; then - compdescribe -I ' -- ' "$@" -else - compdescribe -i "$@" -fi - [[ "$_type" = options ]] && zstyle -t ":completion:${curcontext}:options" prefix-hidden && _hide=yes -while compdescribe -g _args _tmpd _tmpmd _tmps _tmpms; do +while _try "$_type" _expl "$_descr"; do + + if [[ -n "$_showd" ]]; then + compdescribe -I ' -- ' "$@" + else + compdescribe -i "$@" + fi + + 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 -done + compadd "$_args[@]" "$_expl[@]" -ld _tmpd - "$_tmpmd[@]" && _ret=0 + compadd "$_args[@]" "$_expl[@]" -d _tmps - "$_tmpms[@]" && _ret=0 + done +done return _ret |