From b4b6d57e2ce7420e6f3396f529190d15f46b3256 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Thu, 26 Apr 2001 14:40:11 +0000 Subject: 14117 --- Completion/Base/Utility/_arguments | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'Completion/Base') diff --git a/Completion/Base/Utility/_arguments b/Completion/Base/Utility/_arguments index c68700763..3bd95687d 100644 --- a/Completion/Base/Utility/_arguments +++ b/Completion/Base/Utility/_arguments @@ -182,7 +182,7 @@ while [[ "$1" = -(O*|[CRWsw]) ]]; do -R) rawret=yes; shift;; -w) optarg=yes; shift;; -s) singopt=(-s); shift;; - -W) alwopt=yes; shift;; + -W) alwopt=arg; shift;; esac done @@ -282,7 +282,7 @@ if (( $# )) && comparguments -i "$autod" "$singopt[@]" "$@"; then eval ws\=\( "${action[3,-3]}" \) _describe -t "$subc" "$descr" ws -M "$matcher" "$subopts[@]" || - alwopt=yes + alwopt=${alwopt:-yes} tried=yes elif [[ "$action" = \(*\) ]]; then @@ -292,7 +292,7 @@ if (( $# )) && comparguments -i "$autod" "$singopt[@]" "$@"; then eval ws\=\( "${action[2,-2]}" \) _all_labels "$subc" expl "$descr" compadd "$subopts[@]" -a - ws || - alwopt=yes + alwopt=${alwopt:-yes} tried=yes elif [[ "$action" = \{*\} ]]; then @@ -301,7 +301,7 @@ if (( $# )) && comparguments -i "$autod" "$singopt[@]" "$@"; then while _next_label "$subc" expl "$descr"; do eval "$action[2,-2]" && ret=0 done - (( ret )) && alwopt=yes + (( ret )) && alwopt=${alwopt:-yes} tried=yes elif [[ "$action" = \ * ]]; then @@ -311,7 +311,7 @@ if (( $# )) && comparguments -i "$autod" "$singopt[@]" "$@"; then while _next_label "$subc" expl "$descr"; do "$action[@]" && ret=0 done - (( ret )) && alwopt=yes + (( ret )) && alwopt=${alwopt:-yes} tried=yes else @@ -321,7 +321,7 @@ if (( $# )) && comparguments -i "$autod" "$singopt[@]" "$@"; then while _next_label "$subc" expl "$descr"; do "$action[1]" "$subopts[@]" "$expl[@]" "${(@)action[2,-1]}" && ret=0 done - (( ret )) && alwopt=yes + (( ret )) && alwopt=${alwopt:-yes} tried=yes fi fi @@ -340,7 +340,8 @@ if (( $# )) && comparguments -i "$autod" "$singopt[@]" "$@"; then PREFIX="$origpre" IPREFIX="$origipre" - if comparguments -s single; then + if [[ -z "$alwopt" || -z "$tried" || "$alwopt" = arg ]] && + comparguments -s single; then if [[ "$single" = direct ]]; then _all_labels options expl option \ -- cgit 1.4.1