File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -585,6 +585,7 @@ pub fn uu_app() -> Command {
585
585
. version ( crate_version ! ( ) )
586
586
. about ( ABOUT )
587
587
. override_usage ( format_usage ( USAGE ) )
588
+ . args_override_self ( true )
588
589
. infer_long_args ( true )
589
590
. arg (
590
591
Arg :: new ( options:: SUFFIX_FORMAT )
Original file line number Diff line number Diff line change @@ -1376,3 +1376,39 @@ fn no_such_file() {
1376
1376
. fails ( )
1377
1377
. stderr_contains ( "cannot access 'in': No such file or directory" ) ;
1378
1378
}
1379
+
1380
+ #[ test]
1381
+ fn repeat_everything ( ) {
1382
+ let ( at, mut ucmd) = at_and_ucmd ! ( ) ;
1383
+ ucmd. args ( & [
1384
+ "numbers50.txt" ,
1385
+ "--suppress-matched" ,
1386
+ "--suppress-matched" ,
1387
+ "-kzsn" , // spell-checker:disable-line
1388
+ "2" ,
1389
+ "-szkn3" , // spell-checker:disable-line
1390
+ "-b" ,
1391
+ "%03d" ,
1392
+ "-b%03x" ,
1393
+ "-f" ,
1394
+ "xxy_" ,
1395
+ "-fxxz_" , // spell-checker:disable-line
1396
+ "/13/" ,
1397
+ "9" ,
1398
+ "{5}" ,
1399
+ ] )
1400
+ . fails ( )
1401
+ . no_stdout ( )
1402
+ . code_is ( 1 )
1403
+ . stderr_only ( "csplit: '9': line number out of range on repetition 5\n " ) ;
1404
+ let count = glob ( & at. plus_as_string ( "xx*" ) )
1405
+ . expect ( "there should be some splits created" )
1406
+ . count ( ) ;
1407
+ assert_eq ! ( count, 6 ) ;
1408
+ assert_eq ! ( at. read( "xxz_000" ) , generate( 1 , 12 + 1 ) ) ;
1409
+ assert_eq ! ( at. read( "xxz_001" ) , generate( 14 , 17 + 1 ) ) ; // FIXME: GNU starts at 15
1410
+ assert_eq ! ( at. read( "xxz_002" ) , generate( 19 , 26 + 1 ) ) ;
1411
+ assert_eq ! ( at. read( "xxz_003" ) , generate( 28 , 35 + 1 ) ) ;
1412
+ assert_eq ! ( at. read( "xxz_004" ) , generate( 37 , 44 + 1 ) ) ;
1413
+ assert_eq ! ( at. read( "xxz_005" ) , generate( 46 , 50 + 1 ) ) ;
1414
+ }
You can’t perform that action at this time.
0 commit comments