@@ -587,7 +587,7 @@ pub enum Command {
587
587
Boundaries {
588
588
#[ clap( short = 'F' , long, group = "scope-filter-group" ) ]
589
589
filter : Vec < String > ,
590
- #[ clap( long, value_enum) ]
590
+ #[ clap( long, value_enum, default_missing_value = "prompt" , num_args = 0 ..= 1 ) ]
591
591
ignore : Option < BoundariesIgnore > ,
592
592
#[ clap( long, requires = "ignore" ) ]
593
593
reason : Option < String > ,
@@ -3344,4 +3344,20 @@ mod test {
3344
3344
assert_snapshot ! ( args. join( "-" ) . as_str( ) , err) ;
3345
3345
}
3346
3346
}
3347
+
3348
+ #[ test_case:: test_case( & [ "turbo" , "boundaries" ] , true ; "empty" ) ]
3349
+ #[ test_case:: test_case( & [ "turbo" , "boundaries" , "--ignore" ] , true ; "with ignore" ) ]
3350
+ #[ test_case:: test_case( & [ "turbo" , "boundaries" , "--ignore" , "all" ] , true ; "with ignore all" ) ]
3351
+ #[ test_case:: test_case( & [ "turbo" , "boundaries" , "--ignore" , "prompt" ] , true ; "with ignore prompt" ) ]
3352
+ #[ test_case:: test_case( & [ "turbo" , "boundaries" , "--filter" , "ui" ] , true ; "with filter" ) ]
3353
+ fn test_boundaries ( args : & [ & str ] , is_okay : bool ) {
3354
+ let os_args = args. iter ( ) . map ( |s| OsString :: from ( * s) ) . collect ( ) ;
3355
+ let cli = Args :: parse ( os_args) ;
3356
+ if is_okay {
3357
+ cli. unwrap ( ) ;
3358
+ } else {
3359
+ let err = cli. unwrap_err ( ) ;
3360
+ assert_snapshot ! ( args. join( "-" ) . as_str( ) , err) ;
3361
+ }
3362
+ }
3347
3363
}
0 commit comments