1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-04 10:41:11 +02:00

41772: fix bug in handling of long options with _arguments' -A option

This commit is contained in:
Oliver Kiddle 2017-09-28 00:58:21 +02:00
parent 9b4962a772
commit 80a02c10aa
3 changed files with 10 additions and 1 deletions

View file

@ -1,5 +1,8 @@
2017-09-28 Oliver Kiddle <opk@zsh.org>
* 41772: Src/Zle/computil.c, Test/Y03arguments.ztst: fix bug
in handling of long options with _arguments' -A option
* 41762: Completion/Zsh/Context/_value: fix for completion
in assignment to associative array element

View file

@ -1824,7 +1824,7 @@ ca_inactive(Cadef d, char **xor, int cur, int opts)
char *x;
/* current word could be a prefix of a longer one so only do
* exclusions for single-letter options (for option clumping) */
int single = (cur == compcurrent);
int single = !opts && (cur == compcurrent);
for (; (x = (opts ? "-" : *xor)); xor++) {
int excludeall = 0;

View file

@ -333,6 +333,12 @@
0:option after a word
>line: {tst word -x }{}
tst_arguments -A '-*' -x --extra ::first
comptest $'tst word -\t'
0:long option after word that doesn't match -A pattern
>line: {tst word -}{}
>MESSAGE:{no more arguments}
tst_arguments -A'-*' -x :word
comptest $'tst word -\t'
0:option after word that doesn't match -A pattern, no space before pattern