diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2022-04-11 00:17:48 +0200 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2022-04-11 00:17:48 +0200 |
commit | b09f4483416c54c1782824633dfabaf2ec0265b6 (patch) | |
tree | 304bc82642862525ae680c7fbaa249663b10ad57 /Completion/Base/Utility/_arguments | |
parent | 12eb3e5356f2fc3351eed58ef1cef1b8fb83b504 (diff) | |
parent | 6e55c920503071e917619b8cb1a188cd35d772db (diff) | |
download | zsh-b09f4483416c54c1782824633dfabaf2ec0265b6.tar.gz zsh-b09f4483416c54c1782824633dfabaf2ec0265b6.zip |
New upstream version 5.8.1.2-test
Diffstat (limited to 'Completion/Base/Utility/_arguments')
-rw-r--r-- | Completion/Base/Utility/_arguments | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/Completion/Base/Utility/_arguments b/Completion/Base/Utility/_arguments index 136dd5826..5ff34ff47 100644 --- a/Completion/Base/Utility/_arguments +++ b/Completion/Base/Utility/_arguments @@ -7,11 +7,13 @@ local long cmd="$words[1]" descr odescr mesg subopts opt opt2 usecc autod local oldcontext="$curcontext" hasopts rawret optarg singopt alwopt local setnormarg start rest local -a match mbegin mend +integer opt_args_use_NUL_separators=0 subopts=() singopt=() -while [[ "$1" = -([AMO]*|[CRSWnsw]) ]]; do +while [[ "$1" = -([AMO]*|[0CRSWnsw]) ]]; do case "$1" in + -0) opt_args_use_NUL_separators=1; shift ;; -C) usecc=yes; shift ;; -O) subopts=( "${(@P)2}" ); shift 2 ;; -O*) subopts=( "${(@P)${1[3,-1]}}" ); shift ;; @@ -130,8 +132,8 @@ if (( long )); then # variant syntax seen in fetchmail: # --[fetch]all means --fetchall or --all. # maybe needs to be more general - if [[ $start = (#b)(*)\[(*)\](*) ]]; then - tmp+=("${match[1]}${match[2]}${match[3]}" "${match[1]}${match[3]}") + if [[ $start = (#b)--\[(*)\](*) ]]; then + tmp+=("--${match[1]}${match[2]}" "--${match[2]}") else tmp+=($start) fi @@ -388,7 +390,7 @@ if (( $# )) && comparguments -i "$autod" "$singopt[@]" "$@"; then if [[ "$action" = -\>* ]]; then action="${${action[3,-1]##[ ]#}%%[ ]#}" if (( ! $state[(I)$action] )); then - comparguments -W line opt_args + comparguments -W line opt_args $opt_args_use_NUL_separators state+=( "$action" ) state_descr+=( "$descr" ) if [[ -n "$usecc" ]]; then @@ -406,7 +408,7 @@ if (( $# )) && comparguments -i "$autod" "$singopt[@]" "$@"; then local=yes fi - comparguments -W line opt_args + comparguments -W line opt_args $opt_args_use_NUL_separators if [[ "$action" = \ # ]]; then @@ -511,8 +513,8 @@ if (( $# )) && comparguments -i "$autod" "$singopt[@]" "$@"; then tmp2=( "${PREFIX}${(@M)^${(@)${(@)tmp1%%:*}#[-+]}:#?}" ) _describe -O option \ - tmp1 tmp2 -Q -S '' -- \ - tmp3 -Q + tmp1 tmp2 -S '' -- \ + tmp3 [[ -n "$optarg" && "$single" = next && nm -eq $compstate[nmatches] ]] && _all_labels options expl option \ @@ -523,9 +525,9 @@ if (( $# )) && comparguments -i "$autod" "$singopt[@]" "$@"; then else next+=( "$odirect[@]" ) _describe -O option \ - next -Q -M "$matcher" -- \ - direct -QS '' -M "$matcher" -- \ - equal -QqS= -M "$matcher" + next -M "$matcher" -- \ + direct -S '' -M "$matcher" -- \ + equal -qS= -M "$matcher" fi PREFIX="$prevpre" IPREFIX="$previpre" |