44//! has various flags to configure how it's run.
55
66use std:: path:: PathBuf ;
7- use std:: process;
87
98use getopts:: Options ;
109
@@ -261,7 +260,7 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`",
261260 // subcommand.
262261 println ! ( "{}\n " , subcommand_help) ;
263262 let exit_code = if args. is_empty ( ) { 0 } else { 1 } ;
264- process :: exit ( exit_code) ;
263+ crate :: detail_exit ( exit_code) ;
265264 }
266265 } ;
267266
@@ -347,7 +346,7 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`",
347346 } else if verbose {
348347 panic ! ( "No paths available for subcommand `{}`" , subcommand. as_str( ) ) ;
349348 }
350- process :: exit ( exit_code) ;
349+ crate :: detail_exit ( exit_code) ;
351350 } ;
352351
353352 // 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`",
379378 "Sorry, I couldn't figure out which subcommand you were trying to specify.\n \
380379 You may need to move some options to after the subcommand.\n "
381380 ) ;
382- process :: exit ( 1 ) ;
381+ crate :: detail_exit ( 1 ) ;
383382 }
384383 // Extra help text for some commands
385384 match subcommand {
@@ -600,7 +599,7 @@ Arguments:
600599 eprintln ! ( "error: {}" , err) ;
601600 eprintln ! ( "help: the available profiles are:" ) ;
602601 eprint ! ( "{}" , Profile :: all_for_help( "- " ) ) ;
603- std :: process :: exit ( 1 ) ;
602+ crate :: detail_exit ( 1 ) ;
604603 } )
605604 } else {
606605 t ! ( crate :: setup:: interactive_path( ) )
@@ -614,7 +613,7 @@ Arguments:
614613 || matches. opt_str ( "keep-stage-std" ) . is_some ( )
615614 {
616615 eprintln ! ( "--keep-stage not yet supported for x.py check" ) ;
617- process :: exit ( 1 ) ;
616+ crate :: detail_exit ( 1 ) ;
618617 }
619618 }
620619
@@ -805,7 +804,7 @@ fn parse_deny_warnings(matches: &getopts::Matches) -> Option<bool> {
805804 Some ( "warn" ) => Some ( false ) ,
806805 Some ( value) => {
807806 eprintln ! ( r#"invalid value for --warnings: {:?}, expected "warn" or "deny""# , value, ) ;
808- process :: exit ( 1 ) ;
807+ crate :: detail_exit ( 1 ) ;
809808 }
810809 None => None ,
811810 }
0 commit comments