1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-01-01 05:16:05 +01:00

49519: quote completed options as needed and remove the now superfluous quotes from option specifications

This commit is contained in:
Oliver Kiddle 2021-10-26 18:35:36 +02:00
parent 8764cba90b
commit 4e9d0075f4
9 changed files with 21 additions and 14 deletions

View file

@ -1,5 +1,12 @@
2021-10-26 Oliver Kiddle <opk@zsh.org>
* 49519: Completion/Base/Utility/_arguments,
Completion/Darwin/Command/_qtplay, Completion/Unix/Command/_less,
Completion/Unix/Command/_nm, Completion/Unix/Command/_php,
Completion/Unix/Command/_strings, Completion/Unix/Command/_zip,
Completion/X/Command/_gnome-gv: quote completed options as needed
and remove the now superfluous quotes from option specifications
* 49516: Src/Zle/compmatch.c: bail out early from matching
control if command line content is too short for the coanchor
@ -12,7 +19,7 @@
2021-10-23 Oliver Kiddle <opk@zsh.org>
* 49499 based on 49496 by Jun T.: Src/Zle/computil.c
* 49499 based on 49496 by Jun T.: Src/Zle/computil.c,
Test/Y03arguments.ztst: fixes to option -A of _arguments
* 49500: Completion/Linux/Command/_lsns: new completion

View file

@ -513,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 \
@ -525,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"

View file

@ -15,6 +15,6 @@ _arguments -S \
'-t[specify update time]:update time (seconds)' \
'-T[kill time]:ticks' \
'-V[volume]:percentage of normal volume' \
'(-)'{-?,--help,-h}'[display help information]' \
'(-)'{-\?,--help,-h}'[display help information]' \
'(-)*:quicktime file:_files'

View file

@ -80,9 +80,9 @@ _arguments -S -s -A "[-+]*" \
'--no-keypad[disable use of keypad terminal init string]' \
'(-y --max-forw-scroll)'{-y,--max-forw-scroll}'[specify forward scroll limit]' \
'(-z --window)'{-z+,--window=}'[specify scrolling window size]:lines' \
'(-\" --quotes)'{-\"+,--quotes=}'[change quoting character]:quoting characters' \
'(-" --quotes)'{-\"+,--quotes=}'[change quoting character]:quoting characters' \
'(-~ --tilde)'{-~,--tilde}"[don't display tildes after end of file]" \
'(-\# --shift)'{-\#+,--shift=}"[specify amount to move when scrolling horizontally]:number" \
'(-# --shift)'{-\#+,--shift=}"[specify amount to move when scrolling horizontally]:number" \
'--file-size[automatically determine the size of the input file]' \
'--incsearch[search file as each pattern character is typed in]' \
'--line-num-width=[set the width of line number field]:width [7]' \

View file

@ -53,7 +53,7 @@ if _pick_variant -r variant binutils=GNU elftoolchain=elftoolchain elfutils=elfu
'(-C)--demangle[decode symbol names]'
'(--format -P)-f+[specify output format]:format:(bsd sysv posix)'
'(- *)--usage[give a short usage message]'
'(- *)-\\?[display help information]'
'(- *)-?[display help information]'
)
;;
binutils)

View file

@ -93,7 +93,7 @@ _php() {
+ '(hv)' # Help/version options; kept separate by convention
'(- 1 *)'{-h,--help}'[display help information]'
'(- 1 *)'{-v,--version}'[display version information]'
'!(- 1 *)'{-\?,-\\\?,--usage}
'!(- 1 *)'{-\?,--usage}
+ '(im)' # Info/module options (exclusive with everything but -c/-n)
'(fi mc pb pf rf rn sc sv *)'{-i,--info}'[display configuration information (phpinfo())]'

View file

@ -45,7 +45,7 @@ if _pick_variant -r variant binutils=GNU elftoolchain=elftoolchain elfutils=elfu
elfutils)
args+=(
'(- *)--usage[display a short usage message]'
'(- *)-\\?[display help information]'
'(- *)-?[display help information]'
)
;;
esac

View file

@ -115,7 +115,7 @@ case $service in
'(-U)-UU[ignore any Unicode fields]' \
'-W[modify pattern matching so only ** matches /]' \
'-\:[allow extraction outside of extraction base directory]' \
'-\\\^[allow control characters in extracted entries]' \
'-^[allow control characters in extracted entries]' \
'-i[include the following names]:*-*:pattern' \
'-x[exclude the following names]:*-*:pattern' \
"(-p -f -u -l -t -z -n -o -j -C -X -q -qq -a -aa -v -L -M)1:zip file:_files -g '(#i)*.(zip|xpi|[ejw]ar)(-.)'" \

View file

@ -1,6 +1,6 @@
#compdef gnome-gv ggv
_arguments \
'(--help)-\\?[help]' \
'(--help)-?[help]' \
'(--windows)-w[number of empty windows]:number:' \
'*:file: _pspdf -z' --