@@ -419,42 +419,6 @@ void main() {
419419 suggests (noSuggestions),
420420 );
421421 });
422-
423- test (
424- 'suggest all options when previous option is continuous with a value' ,
425- () async {
426- await expectLater (
427- 'example_cli some_command --continuous="yeahoo" ' ,
428- suggests (allOptionsInThisLevel),
429- );
430- },
431- );
432-
433- test (
434- 'suggest all options when previous option is continuous with a value' ,
435- () async {
436- await expectLater (
437- 'example_cli some_command --continuous yeahoo ' ,
438- suggests (allOptionsInThisLevel),
439- );
440- },
441- );
442- });
443-
444- group ('flags' , () {
445- test ('suggest all options when a flag was declared' , () async {
446- await expectLater (
447- 'example_cli some_command --flag ' ,
448- suggests (allOptionsInThisLevel),
449- );
450- });
451-
452- test ('suggest all options when a negated flag was declared' , () async {
453- await expectLater (
454- 'example_cli some_command --no-flag ' ,
455- suggests (allOptionsInThisLevel),
456- );
457- });
458422 });
459423 });
460424
@@ -532,15 +496,6 @@ void main() {
532496 );
533497 });
534498 });
535-
536- group ('flag' , () {
537- test ('suggest all options when a flag was declared' , () async {
538- await expectLater (
539- 'example_cli some_command -f ' ,
540- suggests (allOptionsInThisLevel),
541- );
542- });
543- });
544499 });
545500
546501 group ('invalid options' , () {
@@ -552,15 +507,109 @@ void main() {
552507 });
553508 });
554509
555- group (
556- 'repeating options' ,
557- tags: 'known-issues' ,
558- () {
559- group ('non multi options' , () {});
510+ group ('repeating options' , () {
511+ group ('non multi options' , () {
512+ test ('do not include option after it is specified' , () async {
513+ await expectLater (
514+ 'example_cli some_command --discrete foo ' ,
515+ suggests (allOptionsInThisLevel.except ('--discrete' )),
516+ );
517+ });
518+
519+ test ('do not include abbr option after it is specified' , () async {
520+ await expectLater (
521+ 'example_cli some_command --discrete foo -' ,
522+ suggests (allAbbreviationsInThisLevel.except ('-d' )),
523+ );
524+ });
525+
526+ test ('do not include option after it is specified as abbr' , () async {
527+ await expectLater (
528+ 'example_cli some_command -d foo ' ,
529+ suggests (allOptionsInThisLevel.except ('--discrete' )),
530+ );
531+ });
532+
533+ test (
534+ 'do not include option after it is specified as joined abbr' ,
535+ () async {
536+ await expectLater (
537+ 'example_cli some_command -dfoo ' ,
538+ suggests (allOptionsInThisLevel.except ('--discrete' )),
539+ );
540+ },
541+ tags: 'known-issues' ,
542+ );
543+
544+ test ('do not include flag after it is specified' , () async {
545+ await expectLater (
546+ 'example_cli some_command --flag ' ,
547+ suggests (allOptionsInThisLevel.except ('--flag' )),
548+ );
549+ });
550+
551+ test ('do not include flag after it is specified (abbr)' , () async {
552+ await expectLater (
553+ 'example_cli some_command -f ' ,
554+ suggests (allOptionsInThisLevel.except ('--flag' )),
555+ );
556+ });
560557
561- group ('multi options' , () {});
562- },
563- );
558+ test ('do not include negated flag after it is specified' , () async {
559+ await expectLater (
560+ 'example_cli some_command --no-flag ' ,
561+ suggests (allOptionsInThisLevel.except ('--flag' )),
562+ );
563+ });
564+
565+ test ('do not regard negation of non negatable flag' , () async {
566+ await expectLater (
567+ 'example_cli some_command --no-trueflag ' ,
568+ suggests (allOptionsInThisLevel),
569+ );
570+ });
571+ });
572+
573+ group ('multi options' , () {
574+ test ('include multi option after it is specified' , () async {
575+ await expectLater (
576+ 'example_cli some_command --multi-c yeahoo ' ,
577+ suggests (allOptionsInThisLevel),
578+ );
579+ });
580+
581+ test ('include multi option after it is specified (abbr)' , () async {
582+ await expectLater (
583+ 'example_cli some_command -n yeahoo ' ,
584+ suggests (allOptionsInThisLevel),
585+ );
586+ });
587+
588+ test (
589+ 'include option after it is specified (abbr joined)' ,
590+ () async {
591+ await expectLater (
592+ 'example_cli some_command -nyeahoo ' ,
593+ suggests (allOptionsInThisLevel),
594+ );
595+ },
596+ tags: 'known-issues' ,
597+ );
598+
599+ test ('include discrete multi option value after it is specified' ,
600+ () async {
601+ await expectLater (
602+ 'example_cli some_command --multi-d bar -m ' ,
603+ suggests ({
604+ 'fii' : 'fii help' ,
605+ 'bar' : 'bar help' ,
606+ 'fee' : 'fee help' ,
607+ 'i have space' : 'an allowed option with space on it'
608+ }),
609+ );
610+ });
611+ });
612+ });
564613 });
565614
566615 group ('some_other_command' , () {
0 commit comments