Macro cmd_lib_macros::run_fun
source ยท run_fun!() { /* proc-macro */ }
Expand description
Run commands, returning FunResult
to capture output and to check status.
let version = run_fun!(rustc --version)?;
println!("Your rust version is {}", version);
// with pipes
let n = run_fun!(echo "the quick brown fox jumped over the lazy dog" | wc -w)?;
println!("There are {} words in above sentence", n);