A library for writing host-specific, single-binary configuration management and deployment tools
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

8 years ago
  1. use std::io::Result as IoResult;
  2. use std::process::Command;
  3. use std::process::Output;
  4. pub trait CommandRunner {
  5. fn run_with_args(&self, program: &str, args: &[&str]) -> IoResult<Output>;
  6. }
  7. #[derive(Debug)]
  8. pub struct StdCommandRunner;
  9. impl CommandRunner for StdCommandRunner {
  10. fn run_with_args(&self, program: &str, args: &[&str]) -> IoResult<Output> {
  11. Command::new(program).args(args).output()
  12. }
  13. }
  14. #[cfg(test)]
  15. mod test {
  16. }