Crates.io | command-run |
lib.rs | command-run |
version | 1.1.2 |
source | src |
created_at | 2020-09-05 18:08:41.141565 |
updated_at | 2024-03-16 16:49:49.747152 |
description | Library for running a command in a subprocess |
homepage | |
repository | https://github.com/nicholasbishop/command-run |
max_upload_size | |
id | 285178 |
size | 36,780 |
Rust library for running a command in a subprocess.
This library is a thin wrapper around the std::process::Command
type with a few additional convenient features:
Command
type can be cloned and its fields are publiclog
- this is an optional dependency. It can be disabled by
turning off the logging
feature:
command-run = { version = "*", default-features = false }
os_pipe
- this dependency is used to implement combine_output
.
// This will return an error if the command did not exit successfully
// (controlled with the `check` field).
let output = Command::with_args("echo", &["hello", "world"])
.enable_capture()
.run()?;
assert_eq!(output.stdout_string_lossy(), "hello world\n");