2 releases

0.1.1 Apr 13, 2024
0.1.0 Jan 2, 2024

#27 in #command-output

Download history 1/week @ 2024-01-02 1/week @ 2024-02-13 10/week @ 2024-02-20 9/week @ 2024-02-27 1/week @ 2024-03-26 12/week @ 2024-04-02 141/week @ 2024-04-09 9/week @ 2024-04-16

163 downloads per month

Custom license

6KB
78 lines

cmdwrap

Command for run shell script.

How to use:

  • Synchronous
let command = "pwd";
match cmdwrap::run(command) {
    Ok(output) => {
        println!("{}", output)
    }
    Err(error) => {
        println!("\tCommand execution failed:\n{}", error);
    }
}
  • Asynchronous
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);
}

Dependencies

~1–1.7MB
~37K SLoC