2 stable releases

Uses old Rust 2015

1.0.1 Dec 23, 2016

#74 in #shell

Download history 5/week @ 2020-12-30 10/week @ 2021-01-06 10/week @ 2021-01-13 8/week @ 2021-01-20 16/week @ 2021-01-27 9/week @ 2021-02-03 12/week @ 2021-02-10 25/week @ 2021-02-17 28/week @ 2021-02-24 11/week @ 2021-03-03 8/week @ 2021-03-10 9/week @ 2021-03-17 16/week @ 2021-03-24 9/week @ 2021-03-31 16/week @ 2021-04-07 21/week @ 2021-04-14

52 downloads per month

MIT/Apache

7KB
70 lines

Pipers

A simple Rust library that allows you to pipe commands into each other.

Installation

In your Cargo.toml:

[dependencies]
pipers = "1.0.0"

How to use

It's quite simple really!

let out = Pipe::new("ls /")      // Put in your first command
              .then("grep usr")  // Choose the command you want to pipe into
              .then("head -c 1") // Keep chaining the pipes
              .finally()         // Turn the Pipe into a Result<Child>
              .expect("Commands did not pipe")
              .wait_with_output()
              .expect("failed to wait on child");

assert_eq!("u", &String::from_utf8(out.stdout).unwrap());

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

No runtime deps