about summary refs log tree commit diff
path: root/Test
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2017-01-05 13:31:13 +0100
committerOliver Kiddle <opk@zsh.org>2017-01-05 13:31:13 +0100
commitc2b7c5abbe615bfbd20a910d4093ac3ccdf5525f (patch)
tree560b6fe8c7011b8b4e9fa1bf85aa2a7b35bca1dc /Test
parent8be732cbcc248abfa82ee1b4d0031f684e79aa8b (diff)
downloadzsh-c2b7c5abbe615bfbd20a910d4093ac3ccdf5525f.tar.gz
zsh-c2b7c5abbe615bfbd20a910d4093ac3ccdf5525f.tar.xz
zsh-c2b7c5abbe615bfbd20a910d4093ac3ccdf5525f.zip
40269: handle option exclusion within current word for clumped options
This replaces the change made in 13999 with an alternative approach.
Diffstat (limited to 'Test')
-rw-r--r--Test/Y03arguments.ztst25
1 files changed, 19 insertions, 6 deletions
diff --git a/Test/Y03arguments.ztst b/Test/Y03arguments.ztst
index 47f4747b8..5957bc306 100644
--- a/Test/Y03arguments.ztst
+++ b/Test/Y03arguments.ztst
@@ -479,12 +479,9 @@
 F:shouldn't offer -b as it is already on the command-line
 
  tst_arguments -s : '(-d)-a' -b -c -d
- comptest $'tst -ab\t -\t\eb\eb \C-b-\t'
+ comptest $'tst -ab\t\C-h -\t\eb\eb \C-b-\t'
 0:exclusion with clumped options, in, after and before
->line: {tst -ab}{}
->DESCRIPTION:{option}
->NO:{-c}
->NO:{-d}
+>line: {tst -abc}{}
 >line: {tst -ab -c }{}
 >line: {tst -}{ -ab -c}
 >DESCRIPTION:{option}
@@ -492,7 +489,23 @@ F:shouldn't offer -b as it is already on the command-line
 >NO:{-b}
 >NO:{-c}
 >NO:{-d}
-F:the first tab press shouldn't offer -d since -a is on the command line
+
+ tst_arguments -s '(-conf)-c' '-conf' '-f' '(-)--long' --longer
+ comptest $'tst -c\t\C-h-long\t'
+0:don't prematurely exclude option that current word is a prefix of
+>line: {tst -c}{}
+>DESCRIPTION:{option}
+>NO:{-conf}
+>NO:{-f}
+>line: {tst --long}{}
+>DESCRIPTION:{option}
+>NO:{--long}
+>NO:{--longer}
+
+ tst_arguments -s '(set)-c' - set '-conf' '-f'
+ comptest $'tst -c\t'
+0:don't prematurely exclude option that current word is a prefix of (with sets)
+>line: {tst -conf }{}
 
  tst_arguments -s : -ad '(-d)-a' -b -ca -d
  comptest $'tst -ad\t-b\t'