diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-08-23 10:07:17 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-08-23 10:07:17 +0000 |
commit | f7fa32f091420552d5dbb16ff5f574484508f1de (patch) | |
tree | 82be5f077e6cdddad82a015f77a0308d825cd951 /Completion/Base/_long_options | |
parent | 16060224ac17a8b5a1efb8568643f9a15b14c034 (diff) | |
download | zsh-f7fa32f091420552d5dbb16ff5f574484508f1de.tar.gz zsh-f7fa32f091420552d5dbb16ff5f574484508f1de.tar.xz zsh-f7fa32f091420552d5dbb16ff5f574484508f1de.zip |
zsh-workers/7463
Diffstat (limited to 'Completion/Base/_long_options')
-rw-r--r-- | Completion/Base/_long_options | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/Completion/Base/_long_options b/Completion/Base/_long_options index 0080a48b6..716ff8884 100644 --- a/Completion/Base/_long_options +++ b/Completion/Base/_long_options @@ -112,8 +112,9 @@ if [[ "$tmp" != $_lo_cache_cmd ]]; then # those hyphens and anything from the space or comma after the # option up to the end. - opts=("--${(@)^${(@)${(@M)${(@ps:\n:j:\n:)${(@)${(@M)${(@f)$("$words[1]" --help)}:#[ ]#-*}//,/ -}}:#[ ]#--*}#*--}%%[, ]*}") + opts=("--${(@)^${(@)${(@)${(@M)${(@ps:\n:j:\n:)${(@)${(@M)${(@f)$("$words[1]" --help 2>&1)//\[--/ +--}:#[ ]#-*}//,/ +}}:#[ ]#--*}#*--}%%[, ]*}:#}") # Now remove all ignored options ... @@ -256,15 +257,15 @@ if [[ "$str" = *\=* ]]; then _description expl "$descr" - if [[ "$action[1]" = (\[|\() ]]; then + if [[ "$action[1]" = (\[*\]|\(*\)) ]]; then compadd "$expl[@]" - ${=action[2,-2]} - elif (( $#action )); then - if [[ "$action" = \ * ]]; then - ${(e)=~action} - else - action=($=action) - ${(e)action[1]} "$expl[@]" ${(e)~action[2,-1]} - fi + elif [[ "$action" = \{*\} ]]; then + eval "$action[2,-2]" + elif [[ "$action" = \ * ]]; then + ${(e)=~action} + elif [[ -n "$action" ]]; then + action=($=action) + ${(e)action[1]} "$expl[@]" ${(e)~action[2,-1]} else _message "$descr" fi @@ -308,15 +309,15 @@ if [[ "$str" = *\=* ]]; then _description expl "$partd" - if (( $#parta )); then - if [[ "$parta[1]" = (\[|\() ]]; then - compadd "$expl[@]" - ${=parta[2,-2]} - elif [[ "$parta" = \ * ]]; then - ${(e)=~parta} - else - action=($=parta) - ${(e)~parta[1]} "$expl[@]" ${(e)~action[2,-1]} - fi + if [[ "$parta[1]" = (\[*\]|\(*\)) ]]; then + compadd "$expl[@]" - ${=parta[2,-2]} + elif [[ "$parta" = \{*\} ]]; then + eval "$parta[2,-2]" + elif [[ "$parta" = \ * ]]; then + ${(e)=~parta} + elif [[ -n "$parta" ]]; then + action=($=parta) + ${(e)~action[1]} "$expl[@]" ${(e)~action[2,-1]} else compadd -S '' - "$PREFIX" fi @@ -346,8 +347,6 @@ fi anum=1 for name in "$_lo_cache_names[@]"; do - action="$_lo_cache_actions[anum]" - _description expl option if [[ "$name" = *_optarg_* ]]; then |