summaryrefslogtreecommitdiffstats
path: root/Completion/Base/_values
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-09-15 14:35:16 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-09-15 14:35:16 +0000
commitbc9e764f4e9b95ec4c2a855c4118f6afb994e904 (patch)
treecba20ce3f39ef0f1916ddd3be6a7aa9250e3dc8f /Completion/Base/_values
parentzsh-workers/7840 (diff)
downloadzsh-bc9e764f4e9b95ec4c2a855c4118f6afb994e904.tar
zsh-bc9e764f4e9b95ec4c2a855c4118f6afb994e904.tar.gz
zsh-bc9e764f4e9b95ec4c2a855c4118f6afb994e904.tar.bz2
zsh-bc9e764f4e9b95ec4c2a855c4118f6afb994e904.tar.lz
zsh-bc9e764f4e9b95ec4c2a855c4118f6afb994e904.tar.xz
zsh-bc9e764f4e9b95ec4c2a855c4118f6afb994e904.tar.zst
zsh-bc9e764f4e9b95ec4c2a855c4118f6afb994e904.zip
zsh-workers/7844
Diffstat (limited to 'Completion/Base/_values')
-rw-r--r--Completion/Base/_values41
1 files changed, 14 insertions, 27 deletions
diff --git a/Completion/Base/_values b/Completion/Base/_values
index 21f6908cc..5b413313b 100644
--- a/Completion/Base/_values
+++ b/Completion/Base/_values
@@ -3,7 +3,7 @@
setopt localoptions extendedglob
local name arg def descr xor str tmp ret=1 expl nm="$compstate[nmatches]"
-local snames odescr gdescr sep esep spat
+local snames odescr gdescr sep esep spat tmp1 tmp2 tmp3 opts
typeset -A names onames xors _values
# Probably fill our cache.
@@ -280,34 +280,21 @@ else
# No `=', just complete value names.
- _description expl "$gdescr"
-
- [[ -n "$sep" && ${#snames}+${#names}+${#onames} -ne 1 ]] &&
- expl=( "-qS$sep" "$expl[@]" )
-
- if [[ -n "$compconfig[describe_values]" &&
- "$compconfig[describe_values]" != *\!${words[1]}* ]] &&
- _display descr "$odescr[@]"; then
- if (( $#snames )); then
- tmp=( "${(@M)descr:#(${(j:|:)~snames}) *}" )
- compadd "$expl[@]" -ld tmp -M 'r:|[_-]=* r:|=*' - \
- "${(@)tmp%% *}" && ret=0
- fi
- if (( $#names )); then
- tmp=( "${(@M)descr:#(${(kj:|:)~names}) *}" )
- compadd -S= "$expl[@]" -ld tmp -M 'r:|[_-]=* r:|=*' - \
- "${(@)tmp%% *}" && ret=0
- fi
- if (( $#onames )); then
- tmp=( "${(@M)descr:#(${(kj:|:)~onames}) *}" )
- compadd -qS= "$expl[@]" -ld tmp -M 'r:|[_-]=* r:|=*' - \
- "${(@)tmp%% *}" && ret=0
- fi
+ if [[ -n "$sep" && ${#snames}+${#names}+${#onames} -ne 1 ]]; then
+ opts=( "-qS$sep" )
else
- compadd "$expl[@]" -M 'r:|[_-]=* r:|=*' - "$snames[@]" && ret=0
- compadd -S= "$expl[@]" -M 'r:|[_-]=* r:|=*' - "${(@k)names}" && ret=0
- compadd -qS= "$expl[@]" -M 'r:|[_-]=* r:|=*' - "${(@k)onames}" && ret=0
+ opts=()
fi
+
+ tmp1=( "${(@M)odescr:#(${(j:|:)~snames}):*}" )
+ tmp2=( "${(@M)odescr:#(${(kj:|:)~names}):*}" )
+ tmp3=( "${(@M)odescr:#(${(kj:|:)~onames}):*}" )
+
+ _describe "$gdescr" \
+ tmp1 "$opts[@]" -M 'r:|[_-]=* r:|=*' -- \
+ tmp2 -S= "$opts[@]" -M 'r:|[_-]=* r:|=*' -- \
+ tmp3 -qS= "$opts[@]" -M 'r:|[_-]=* r:|=*'
+
return ret
fi