diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-05-16 11:15:24 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-05-16 11:15:24 +0000 |
commit | 0129f41d8002b403d6b335c27264df2cdee7369d (patch) | |
tree | 3f2d22b56fb6ce2dec01a56a4f8357f3eb59e74b /Completion/Base/_arguments | |
parent | aa17f0db6d4dc751a636ca150f9b7942da3f6885 (diff) | |
download | zsh-0129f41d8002b403d6b335c27264df2cdee7369d.tar.gz zsh-0129f41d8002b403d6b335c27264df2cdee7369d.tar.xz zsh-0129f41d8002b403d6b335c27264df2cdee7369d.zip |
make _arguments take the attempt to add matches as an indication not to do default option-completion (11406)
Diffstat (limited to 'Completion/Base/_arguments')
-rw-r--r-- | Completion/Base/_arguments | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments index 453e3d3e2..8aad10852 100644 --- a/Completion/Base/_arguments +++ b/Completion/Base/_arguments @@ -163,7 +163,7 @@ done zstyle -s ":completion:${curcontext}:options" auto-description autod if (( $# )) && comparguments "$multi[@]" "$autod" "$@"; then - local action noargs aret expl local + local action noargs aret expl local tried local next direct odirect equal single match matched ws tmp1 tmp2 tmp3 local opts subc tc prefix suffix descrs actions subcs local origpre="$PREFIX" origipre="$IPREFIX" @@ -244,6 +244,7 @@ if (( $# )) && comparguments "$multi[@]" "$autod" "$@"; then _message "$descr" mesg=yes + tried=yes elif [[ "$action" = \(\(*\)\) ]]; then @@ -252,6 +253,7 @@ if (( $# )) && comparguments "$multi[@]" "$autod" "$@"; then eval ws\=\( "${action[3,-3]}" \) _describe -t "$subc" "$descr" ws -M "$match" "$subopts[@]" + tried=yes elif [[ "$action" = \(*\) ]]; then @@ -259,6 +261,7 @@ if (( $# )) && comparguments "$multi[@]" "$autod" "$@"; then _all_labels "$subc" expl "$descr" \ compadd "$subopts[@]" - ${=action[2,-2]} + tried=yes elif [[ "$action" = \{*\} ]]; then # A string in braces is evaluated. @@ -266,6 +269,7 @@ if (( $# )) && comparguments "$multi[@]" "$autod" "$@"; then while _next_label "$subc" expl "$descr"; do eval "$action[2,-2]" done + tried=yes elif [[ "$action" = \ * ]]; then # If the action starts with a space, we just call it. @@ -274,6 +278,7 @@ if (( $# )) && comparguments "$multi[@]" "$autod" "$@"; then while _next_label "$subc" expl "$descr"; do "$action[@]" done + tried=yes else # Otherwise we call it with the description-arguments. @@ -282,6 +287,7 @@ if (( $# )) && comparguments "$multi[@]" "$autod" "$@"; then while _next_label "$subc" expl "$descr"; do "$action[1]" "$subopts[@]" "$expl[@]" "${(@)action[2,-1]}" done + tried=yes fi fi fi @@ -293,8 +299,7 @@ if (( $# )) && comparguments "$multi[@]" "$autod" "$@"; then if [[ -z "$matched$hasopts" ]] && _requested options && { [[ -n "$ismulti" ]] || ! zstyle -T ":completion:${curcontext}:options" prefix-needed || - [[ "$origpre" = [-+]* || - ( -z "$aret$mesg" && nm -eq compstate[nmatches] ) ]] } ; then + [[ "$origpre" = [-+]* || -z "$aret$mesg$tried" ]] } ; then local prevpre="$PREFIX" previpre="$IPREFIX" hasopts=yes @@ -351,6 +356,7 @@ if (( $# )) && comparguments "$multi[@]" "$autod" "$@"; then PREFIX="$prevpre" IPREFIX="$previpre" fi + [[ -n "$tried" ]] && break done if [[ -n "$opts" && -z "$aret$matched$mesg" && nm -eq compstate[nmatches] ]]; then |