[−][src]Function run_script::run
pub fn run(
script: &str,
args: &Vec<String>,
options: &ScriptOptions
) -> Result<(i32, String, String), ScriptError>
Invokes the provided script content and returns the invocation output.
Arguments
script
- The script contentargs
- The script command line argumentsoptions
- Options provided to the script runner
Example
extern crate run_script; use run_script::ScriptOptions; fn main() { let options = ScriptOptions::new(); let args = vec![]; let (code, output, error) = run_script::run( r#" echo "Directory Info:" dir "#, &args, &options ).unwrap(); println!("Exit Code: {}", code); println!("Output: {}", output); println!("Error: {}", error); }