/// Run the program given matches from [compile].
Run the program given matches from [compile].
Run the program given matches from [ compile ] .
pub fn run(matches: &ArgMatches) -> Result<()> {
    if let Some(matches) = matches.subcommand_matches(SUBCOMMAND_AST) {
        let build_dir = matches.value_of("build-dir").unwrap();
        let inputs = matches.values_of("inputs").unwrap();
        let input_strings = inputs
            .into_iter()
            .map(|input| input.to_owned())
            .collect::<Vec<_>>();
        let outputs = matches.values_of("outputs").unwrap();
        let output_strings = outputs
            .into_iter()
            .map(|output| output.to_owned())
            .collect::<Vec<_>>();
        run_ast(build_dir, input_strings, output_strings)
    } else if let Some(matches) = matches.subcommand_matches(SUBCOMMAND_JS) {
        let inputs = matches.values_of("inputs").unwrap();
        let input_strings = inputs
            .into_iter()
            .map(|input| input.to_owned())
            .collect::<Vec<_>>();
        let outputs = matches.values_of("outputs").unwrap();
        let output_strings = outputs
            .into_iter()
            .map(|output| output.to_owned())
            .collect::<Vec<_>>();
        run_js(input_strings, output_strings)
    } else if let Some(matches) = matches.subcommand_matches(SUBCOMMAND_PACKAGE_JSON) {
        let input = matches.value_of("input").unwrap();
        let output = matches.value_of("output").unwrap();
        run_package_json(input, output)
    } else {
        unreachable!()
    }
}
pub fn run ( matches : & ArgMatches ) -> Result < ( ) > { if let Some ( matches ) = matches . subcommand_matches ( SUBCOMMAND_AST ) { let build_dir = matches . value_of ( " " ) . unwrap ( ) ; let inputs = matches . values_of ( " " ) . unwrap ( ) ; let input_strings = inputs . into_iter ( ) . map ( | input | input . to_owned ( ) ) . collect :: < Vec < _ > > ( ) ; let outputs = matches . values_of ( " " ) . unwrap ( ) ; let output_strings = outputs . into_iter ( ) . map ( | output | output . to_owned ( ) ) . collect :: < Vec < _ > > ( ) ; run_ast ( build_dir , input_strings , output_strings ) } else if let Some ( matches ) = matches . subcommand_matches ( SUBCOMMAND_JS ) { let inputs = matches . values_of ( " " ) . unwrap ( ) ; let input_strings = inputs . into_iter ( ) . map ( | input | input . to_owned ( ) ) . collect :: < Vec < _ > > ( ) ; let outputs = matches . values_of ( " " ) . unwrap ( ) ; let output_strings = outputs . into_iter ( ) . map ( | output | output . to_owned ( ) ) . collect :: < Vec < _ > > ( ) ; run_js ( input_strings , output_strings ) } else if let Some ( matches ) = matches . subcommand_matches ( SUBCOMMAND_PACKAGE_JSON ) { let input = matches . value_of ( " " ) . unwrap ( ) ; let output = matches . value_of ( " " ) . unwrap ( ) ; run_package_json ( input , output ) } else { unreachable ! ( ) } }
Run the program given matches from [compile].
Run the program given matches from [ compile ] .
matches
&ArgMatches