Crates.io | cmdwrap |
lib.rs | cmdwrap |
version | 0.1.1 |
source | src |
created_at | 2024-01-02 06:34:14.67195 |
updated_at | 2024-04-13 13:09:08.340268 |
description | Command for run shell script |
homepage | |
repository | https://github.com/prongbang/cmdwrap |
max_upload_size | |
id | 1085908 |
size | 8,508 |
Command for run shell script.
let command = "pwd";
match cmdwrap::run(command) {
Ok(output) => {
println!("{}", output)
}
Err(error) => {
println!("\tCommand execution failed:\n{}", error);
}
}
use futures_util::pin_mut;
use futures_util::stream::StreamExt;
let command = "pwd";
let mut s = cmdwrap::run_stream(command);
pin_mut!(s); // needed for iteration
while let Some(value) = s.next().await {
println!("{}", value.output);
}