macro_rules! cmd {
( $program:expr $(, $arg:expr )* $(,)? ) => { ... };
}
Expand description
Create a command with any number of of positional arguments, which may be
different types (anything that implements
Into<OsString>
).
See also the cmd
function, which takes a collection of
arguments.
ยงExample
use duct::cmd;
use std::path::Path;
let arg1 = "foo";
let arg2 = "bar".to_owned();
let arg3 = Path::new("baz");
let output = cmd!("echo", arg1, arg2, arg3).read();
assert_eq!("foo bar baz", output.unwrap());