diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2001-04-26 14:40:11 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2001-04-26 14:40:11 +0000 |
commit | b4b6d57e2ce7420e6f3396f529190d15f46b3256 (patch) | |
tree | 1ced8ff63e5e8bda978920387e3fd4102a1dd193 /Completion/Base/Utility/_arguments | |
parent | 17539b1e2c0555985829e068a2accb7676744351 (diff) | |
download | zsh-b4b6d57e2ce7420e6f3396f529190d15f46b3256.tar.gz zsh-b4b6d57e2ce7420e6f3396f529190d15f46b3256.tar.xz zsh-b4b6d57e2ce7420e6f3396f529190d15f46b3256.zip |
14117
Diffstat (limited to 'Completion/Base/Utility/_arguments')
-rw-r--r-- | Completion/Base/Utility/_arguments | 15 |
1 files changed, 8 insertions, 7 deletions
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 \ |