#command-output #execute-command #utf-8 #system #execution #successful #termination

just-run

Convenience crate for executing system commands with the expectation of successful termination and UTF-8 encoded output, for basic straightforward command execution scenarios

1 unstable release

0.1.0 Oct 4, 2024

#3 in #termination

MIT license

11KB
118 lines

just-run

just-run is a simple convenience crate for executing system commands with the expectation of successful termination and UTF-8 encoded output. It aims to handle the most common case without extensive configuration or edge case coverage.

Usage

use just_run::{run, Success};

let Success { stdout, stderr } = run("echo", ["Hello world!"]).expect("Command failed");
println!("{stdout}");

See also

For more advanced use cases, consider checking out the duct crate or using the standard library tools directly.


lib.rs:

just-run

just-run is a simple convenience crate for executing system commands with the expectation of successful termination and UTF-8 encoded output. It aims to handle the most common case without extensive configuration or edge case coverage.

Usage

use just_run::{run, Success};

let Success { stdout, stderr } = run("echo", ["Hello world!"]).expect("Command failed");
println!("{stdout}");

For more advanced use cases, consider checking out the duct crate or using the standard library tools directly.

Future

This crate focuses on convenience. It might expand to include async command execution or other features in the future, but it is not meant to cover all use cases.

No runtime deps