Macro blue_build_utils::cmd

source ·
macro_rules! cmd {
    ($command:expr) => { ... };
    ($command:ident, $($tail:tt)*) => { ... };
    ($command:expr, $($tail:tt)*) => { ... };
    (@ $command:ident $(,)?) => { ... };
    (@ $command:ident, for $for_expr:expr $(, $($tail:tt)*)?) => { ... };
    (@ $command:ident, for $iter:ident in $for_expr:expr => [ $($arg:expr),* $(,)? ] $(, $($tail:tt)*)?) => { ... };
    (@ $command:ident, for $iter:ident in $for_expr:expr => $arg:expr $(, $($tail:tt)*)?) => { ... };
    (@ $command:ident, if let $let_pat:pat = $if_expr:expr => [ $($arg:expr),* $(,)? ] $(, $($tail:tt)*)?) => { ... };
    (@ $command:ident, if let $let_pat:pat = $if_expr:expr => $arg:expr $(, $($tail:tt)*)?) => { ... };
    (@ $command:ident, if $if_expr:expr => [ $($arg:expr),* $(,)?] $(, $($tail:tt)*)?) => { ... };
    (@ $command:ident, if $if_expr:expr => $arg:expr $(, $($tail:tt)*)?) => { ... };
    (@ $command:ident, |$cmd_ref:ident|? $op:block $(, $($tail:tt)*)?) => { ... };
    (@ $command:ident, |$cmd_ref:ident| $op:block $(, $($tail:tt)*)?) => { ... };
    (@ $command:ident, $key:expr => $value:expr $(, $($tail:tt)*)?) => { ... };
    (@ $command:ident, current_dir = $dir:expr $(, $($tail:tt)*)?) => { ... };
    (@ $command:ident, stdin = $pipe:expr $(, $($tail:tt)*)?) => { ... };
    (@ $command:ident, stdout = $pipe:expr $(, $($tail:tt)*)?) => { ... };
    (@ $command:ident, stderr = $pipe:expr $(, $($tail:tt)*)?) => { ... };
    (@ $command:ident, $arg:expr $(, $($tail:tt)*)?) => { ... };
}
Expand description

Creates or modifies a std::process::Command adding args.

§Examples

use blue_build_utils::cmd;

const NAME: &str = "Bob";
let mut command = cmd!("echo", "Hello world!");
cmd!(command, "This is Joe.", format!("And this is {NAME}"));
command.status().unwrap();