commandspec
Simple Rust macro for building std::process::Command
objects. Uses macro_rules! and works on stable.
[]
= "0.3.0"
Then:
extern crate commandspec;
use CommandSpec; // .execute() method on Command
use Command;
execute!?; // () on success (error code 0), CommandError for all else
Format of the commandspec input, in order:
- (optional)
cd <path>
to set the current working directory of the command, where path can be a literal, a quoted string, or format variable. - (optional) one or more
export <name>=<value>
lines to set environment variables, with the same formatting options. - Last, a command you want to invoke, optionally with format arguments.
Features:
- format-like invocation makes it easy to interpolate variables, with automatic quoting
- Equivalent syntax to shell when prototyping
- Works on stable Rust.
License
MIT or Apache-2.0, at your option.