command-run 1.1.2

Library for running a command in a subprocess
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use command_run::{Command, Error};

#[test]
fn test_example() -> Result<(), Error> {
    // Begin readme example
    // This will return an error if the command did not exit successfully
    // (controlled with the `check` field).
    let output = Command::with_args("echo", &["hello", "world"])
        .enable_capture()
        .run()?;
    assert_eq!(output.stdout_string_lossy(), "hello world\n");
    // End readme example
    Ok(())
}