mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-11-19 13:33:52 +01:00
make $compcontext more powerful and easier to use for simple cases (12449)
This commit is contained in:
parent
4f9ff8206b
commit
3896f72f4d
@ -1,3 +1,9 @@
|
||||
2000-08-01 Sven Wischnowsky <wischnow@zsh.org>
|
||||
|
||||
* 12449: Completion/Base/_arguments, Completion/Base/_values,
|
||||
Completion/Core/_complete, Doc/Zsh/compsys.yo: make $compcontext
|
||||
more powerful and easier to use for simple cases
|
||||
|
||||
2000-07-31 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* Config/version.mk: 3.1.9-dev-4.
|
||||
|
@ -270,8 +270,9 @@ if (( $# )) && comparguments -i "$autod" "$@"; then
|
||||
|
||||
# Anything inside `(...)' is added directly.
|
||||
|
||||
_all_labels "$subc" expl "$descr" \
|
||||
compadd "$subopts[@]" - ${=action[2,-2]}
|
||||
eval ws\=\( "${action[2,-2]}" \)
|
||||
|
||||
_all_labels "$subc" expl "$descr" compadd "$subopts[@]" -a - ws
|
||||
tried=yes
|
||||
elif [[ "$action" = \{*\} ]]; then
|
||||
|
||||
@ -294,7 +295,7 @@ if (( $# )) && comparguments -i "$autod" "$@"; then
|
||||
|
||||
# Otherwise we call it with the description-arguments.
|
||||
|
||||
set -A action ${=~action}
|
||||
eval "action=( $action )"
|
||||
while _next_label "$subc" expl "$descr"; do
|
||||
"$action[1]" "$subopts[@]" "$expl[@]" "${(@)action[2,-1]}"
|
||||
done
|
||||
|
@ -119,8 +119,9 @@ if compvalues -i "$@"; then
|
||||
|
||||
# Anything inside `(...)' is added directly.
|
||||
|
||||
_all_labels arguments expl "$descr" \
|
||||
compadd "$subopts[@]" - ${=action[2,-2]}
|
||||
eval ws\=\( "${action[2,-2]}" \)
|
||||
|
||||
_all_labels arguments expl "$descr" compadd "$subopts[@]" -a - ws
|
||||
elif [[ "$action" = \{*\} ]]; then
|
||||
|
||||
# A string in braces is evaluated.
|
||||
|
Loading…
Reference in New Issue
Block a user