cmd

Macro cmd 

Source
macro_rules! cmd {
    ($app:tt $($q:tt)*) => { ... };
}
Expand description

Create a std::process::Output in the style of a terminal line

The first item is the program name. Following items are passed as args

Example

cmd!(echo Hello World);

Single words are stringified

// (You can not actually compare Commands)
cmd!(echo test) == cmd!(echo "test")

Escaping spaces with quotes is possible

let mut x = cmd!(echo "Hello World!");

Identifiers in parantheses are interpolated

let name = "Steve";
cmd!(echo (name));

Identifiers followed by .. are interpolated as iterators

let names = ["Steve", "Mike"];
cmd!(echo (names..));

Use var(name) to interpolate env vars

cmd!(echo (var(PATH)));

Note that this will use the callers environment variables, not any passed into the command