clingwrap 0.7.0

types and functions to implement command line programs
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Capture the combined stdout and stderr of a shell script snippet.

use clingwrap::runner::*;
use std::process::Command;

fn main() {
    env_logger::init();

    let mut cmd = Command::new("bash");
    cmd.arg("-c");
    cmd.arg("echo hello; echo world 1>&2");
    let mut runner = CommandRunner::new(cmd);
    runner.combine_stdouterr().unwrap();
    let output = runner.execute().unwrap();
    println!("{output:#?}");
}