pub fn handle_options(mut args: Vec<String>) -> Option<getopts::Matches> {
    // Throw away the first argument, the name of the binary
    let _binary = args.remove(0).unwrap();

    if args.is_empty() {
        usage();
        return None;
    }

    let matches =
        match getopts::getopts(args.as_slice(), config::optgroups().as_slice()) {
            Ok(m) => m,
            Err(f) => {
                early_error(f.to_string().as_slice());
            }
        };

    if matches.opt_present("h") || matches.opt_present("help") {
        usage();
        return None;
    }

    // Don't handle -W help here, because we might first load plugins.

    let r = matches.opt_strs("Z");
    if r.iter().any(|x| x.as_slice() == "help") {
        describe_debug_flags();
        return None;
    }

    let cg_flags = matches.opt_strs("C");
    if cg_flags.iter().any(|x| x.as_slice() == "help") {
        describe_codegen_flags();
        return None;
    }

    if cg_flags.contains(&"passes=list".to_string()) {
        unsafe { ::llvm::LLVMRustPrintPasses(); }
        return None;
    }

    if matches.opt_present("version") {
        match version("rustc", &matches) {
            Some(err) => early_error(err.as_slice()),
            None => return None
        }
    }

    Some(matches)
}
/// Process command line options. Emits messages as appropriate. If compilation
/// should continue, returns a getopts::Matches object parsed from args, otherwise
/// returns None.
Process command line options. Emits messages as appropriate. If compilation
should continue, returns a getopts::Matches object parsed from args, otherwise
returns None.
Process command line options . Emits messages as appropriate . If compilation should continue returns a getopts :: Matches object parsed from args otherwise returns None .
pub fn handle_options(mut args: Vec<String>) -> Option<getopts::Matches> {
    // Throw away the first argument, the name of the binary
    let _binary = args.remove(0).unwrap();
    if args.is_empty() {
        usage();
        return None;
    }
    let matches =
        match getopts::getopts(args.as_slice(), config::optgroups().as_slice()) {
            Ok(m) => m,
            Err(f) => {
                early_error(f.to_string().as_slice());
            }
        };
    if matches.opt_present("h") || matches.opt_present("help") {
        usage();
        return None;
    }
    // Don't handle -W help here, because we might first load plugins.
    let r = matches.opt_strs("Z");
    if r.iter().any(|x| x.as_slice() == "help") {
        describe_debug_flags();
        return None;
    }
    let cg_flags = matches.opt_strs("C");
    if cg_flags.iter().any(|x| x.as_slice() == "help") {
        describe_codegen_flags();
        return None;
    }
    if cg_flags.contains(&"passes=list".to_string()) {
        unsafe { ::llvm::LLVMRustPrintPasses(); }
        return None;
    }
    if matches.opt_present("version") {
        match version("rustc", &matches) {
            Some(err) => early_error(err.as_slice()),
            None => return None
        }
    }
    Some(matches)
}
pub fn handle_options ( mut args : Vec < String > ) -> Option < getopts :: Matches > { // Throw away the first argument, the name of the binary let _binary = args . remove ( 0 ) . unwrap ( ) ; if args . is_empty ( ) { usage ( ) ; return None ; } let matches = match getopts :: getopts ( args . as_slice ( ) , config :: optgroups ( ) . as_slice ( ) ) { Ok ( m ) => m , Err ( f ) => { early_error ( f . to_string ( ) . as_slice ( ) ) ; } } ; if matches . opt_present ( " " ) || matches . opt_present ( " " ) { usage ( ) ; return None ; } // Don't handle -W help here, because we might first load plugins. let r = matches . opt_strs ( " " ) ; if r . iter ( ) . any ( | x | x . as_slice ( ) == " " ) { describe_debug_flags ( ) ; return None ; } let cg_flags = matches . opt_strs ( " " ) ; if cg_flags . iter ( ) . any ( | x | x . as_slice ( ) == " " ) { describe_codegen_flags ( ) ; return None ; } if cg_flags . contains ( & " " . to_string ( ) ) { unsafe { :: llvm :: LLVMRustPrintPasses ( ) ; } return None ; } if matches . opt_present ( " " ) { match version ( " " , & matches ) { Some ( err ) => early_error ( err . as_slice ( ) ) , None => return None } } Some ( matches ) }
Process command line options.
Process command line options .
args
Vec<String>
args
Vec<String>