Crates.io | cradle |
lib.rs | cradle |
version | 0.2.2 |
source | src |
created_at | 2021-06-01 17:06:27.206019 |
updated_at | 2022-05-03 08:51:49.020022 |
description | Execute child processes with ease |
homepage | https://github.com/soenkehahn/cradle |
repository | https://github.com/soenkehahn/cradle |
max_upload_size | |
id | 404820 |
size | 136,667 |
cradle
is a library for executing child processes.
It provides a more convenient interface than
std::process::Command.
Here's an example:
use cradle::prelude::*;
fn main() {
// output git version
run!(%"git --version");
// output configured git user
let (StdoutTrimmed(git_user), Status(status)) = run_output!(%"git config --get user.name");
if status.success() {
eprintln!("git user: {}", git_user);
} else {
eprintln!("git user not configured");
}
}
For comprehensive documentation, head over to docs.rs/cradle.
cradle
is meant to make it as easy as possible to run child processes,
while making it hard to use incorrectly.
As such it provides an interface that is concise and flexible,
and tries to avoid surprising behavior.
cradle
does not try to emulate the syntax or functionality of bash
or other shells,
such as pipes (|
), globs (*
), or other string expansion.
Instead, it aims to be a convenient wrapper around the
operating system's interface for running child processes.
The minimal supported rust version is 0.41
.