[][src]Macro cmd_lib::run_fun

macro_rules! run_fun {
    ($cmd:ident $($arg:tt)*) => { ... };
    ($($arg:tt)*) => { ... };
}

run_fun! --> FunResult

let version = run_fun!("rustc --version")?;
info!("Your rust version is {}", version.trim());

// with pipes
let n = run_fun!("echo the quick brown fox jumped over the lazy dog | wc -w")?;
info!("There are {} words in above sentence", n.trim());

// without string quotes
let files = run_fun!(du -ah . | sort -hr | head -n 10)?;