From c2b7c5abbe615bfbd20a910d4093ac3ccdf5525f Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Thu, 5 Jan 2017 13:31:13 +0100 Subject: 40269: handle option exclusion within current word for clumped options This replaces the change made in 13999 with an alternative approach. --- Test/Y03arguments.ztst | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'Test') 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' -- cgit 1.4.1