mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-11 00:51:05 +02:00
two fixes: try all actions that have to be tried (but only once), execute actions if we aren't after an option already (in the same word) (14733)
This commit is contained in:
parent
4b44bbb3fb
commit
a7340e627b
2 changed files with 98 additions and 88 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2001-06-06 Sven Wischnowsky <wischnow@zsh.org>
|
||||||
|
|
||||||
|
* 14733: Completion/Base/Utility/_arguments: two fixes: try all
|
||||||
|
actions that have to be tried (but only once), execute actions
|
||||||
|
if we aren't after an option already (in the same word)
|
||||||
|
|
||||||
001-06-06 Andrej Borsenkow <bor@zsh.org>
|
001-06-06 Andrej Borsenkow <bor@zsh.org>
|
||||||
|
|
||||||
* unposted; based on 14679 (me) and 14693 (Bart): configure.ac,
|
* unposted; based on 14679 (me) and 14693 (Bart): configure.ac,
|
||||||
|
|
|
@ -186,6 +186,8 @@ while [[ "$1" = -(O*|[CRWsw]) ]]; do
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
[[ "$PREFIX" = [-+] ]] && alwopt=arg
|
||||||
|
|
||||||
zstyle -s ":completion:${curcontext}:options" auto-description autod
|
zstyle -s ":completion:${curcontext}:options" auto-description autod
|
||||||
|
|
||||||
if (( $# )) && comparguments -i "$autod" "$singopt[@]" "$@"; then
|
if (( $# )) && comparguments -i "$autod" "$singopt[@]" "$@"; then
|
||||||
|
@ -227,13 +229,14 @@ if (( $# )) && comparguments -i "$autod" "$singopt[@]" "$@"; then
|
||||||
while true; do
|
while true; do
|
||||||
while _tags; do
|
while _tags; do
|
||||||
anum=1
|
anum=1
|
||||||
|
if [[ -z "$tried" ]]; then
|
||||||
while [[ anum -le $#descrs ]]; do
|
while [[ anum -le $#descrs ]]; do
|
||||||
|
|
||||||
action="$actions[anum]"
|
action="$actions[anum]"
|
||||||
descr="$descrs[anum]"
|
descr="$descrs[anum]"
|
||||||
subc="$subcs[anum++]"
|
subc="$subcs[anum++]"
|
||||||
|
|
||||||
if [[ -z "$tried" ]] && { [[ -n "$matched" ]] || _requested "$subc" }; then
|
if [[ -n "$matched" ]] || _requested "$subc"; then
|
||||||
|
|
||||||
curcontext="${oldcontext%:*}:$subc"
|
curcontext="${oldcontext%:*}:$subc"
|
||||||
|
|
||||||
|
@ -274,7 +277,7 @@ if (( $# )) && comparguments -i "$autod" "$singopt[@]" "$@"; then
|
||||||
_message "$descr"
|
_message "$descr"
|
||||||
mesg=yes
|
mesg=yes
|
||||||
tried=yes
|
tried=yes
|
||||||
|
alwopt=${alwopt:-yes}
|
||||||
elif [[ "$action" = \(\(*\)\) ]]; then
|
elif [[ "$action" = \(\(*\)\) ]]; then
|
||||||
|
|
||||||
# ((...)) contains literal strings with descriptions.
|
# ((...)) contains literal strings with descriptions.
|
||||||
|
@ -327,6 +330,7 @@ if (( $# )) && comparguments -i "$autod" "$singopt[@]" "$@"; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
if [[ -z "$hasopts" &&
|
if [[ -z "$hasopts" &&
|
||||||
-z "$matched" &&
|
-z "$matched" &&
|
||||||
( -z "$tried" || -n "$alwopt" ) &&
|
( -z "$tried" || -n "$alwopt" ) &&
|
||||||
|
|
Loading…
Reference in a new issue