4
4
//! has various flags to configure how it's run.
5
5
6
6
use std:: path:: PathBuf ;
7
- use std:: process;
8
7
9
8
use getopts:: Options ;
10
9
@@ -261,7 +260,7 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`",
261
260
// subcommand.
262
261
println ! ( "{}\n " , subcommand_help) ;
263
262
let exit_code = if args. is_empty ( ) { 0 } else { 1 } ;
264
- process :: exit ( exit_code) ;
263
+ crate :: detail_exit ( exit_code) ;
265
264
}
266
265
} ;
267
266
@@ -347,7 +346,7 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`",
347
346
} else if verbose {
348
347
panic ! ( "No paths available for subcommand `{}`" , subcommand. as_str( ) ) ;
349
348
}
350
- process :: exit ( exit_code) ;
349
+ crate :: detail_exit ( exit_code) ;
351
350
} ;
352
351
353
352
// Done specifying what options are possible, so do the getopts parsing
@@ -379,7 +378,7 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`",
379
378
"Sorry, I couldn't figure out which subcommand you were trying to specify.\n \
380
379
You may need to move some options to after the subcommand.\n "
381
380
) ;
382
- process :: exit ( 1 ) ;
381
+ crate :: detail_exit ( 1 ) ;
383
382
}
384
383
// Extra help text for some commands
385
384
match subcommand {
@@ -600,7 +599,7 @@ Arguments:
600
599
eprintln ! ( "error: {}" , err) ;
601
600
eprintln ! ( "help: the available profiles are:" ) ;
602
601
eprint ! ( "{}" , Profile :: all_for_help( "- " ) ) ;
603
- std :: process :: exit ( 1 ) ;
602
+ crate :: detail_exit ( 1 ) ;
604
603
} )
605
604
} else {
606
605
t ! ( crate :: setup:: interactive_path( ) )
@@ -614,7 +613,7 @@ Arguments:
614
613
|| matches. opt_str ( "keep-stage-std" ) . is_some ( )
615
614
{
616
615
eprintln ! ( "--keep-stage not yet supported for x.py check" ) ;
617
- process :: exit ( 1 ) ;
616
+ crate :: detail_exit ( 1 ) ;
618
617
}
619
618
}
620
619
@@ -805,7 +804,7 @@ fn parse_deny_warnings(matches: &getopts::Matches) -> Option<bool> {
805
804
Some ( "warn" ) => Some ( false ) ,
806
805
Some ( value) => {
807
806
eprintln ! ( r#"invalid value for --warnings: {:?}, expected "warn" or "deny""# , value, ) ;
808
- process :: exit ( 1 ) ;
807
+ crate :: detail_exit ( 1 ) ;
809
808
}
810
809
None => None ,
811
810
}
0 commit comments