You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
439 B
20 lines
439 B
use std::io::Result as IoResult;
|
|
use std::process::Command;
|
|
use std::process::Output;
|
|
|
|
pub trait CommandRunner {
|
|
fn run_with_args(&self, program: &str, args: &[&str]) -> IoResult<Output>;
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
pub struct StdCommandRunner;
|
|
|
|
impl CommandRunner for StdCommandRunner {
|
|
fn run_with_args(&self, program: &str, args: &[&str]) -> IoResult<Output> {
|
|
Command::new(program).args(args).output()
|
|
}
|
|
}
|
|
|
|
#[cfg(test)]
|
|
mod test {
|
|
}
|