pipers

Crates.iopipers
lib.rspipers
version1.0.1
sourcesrc
created_at2016-12-23 14:08:20.216695
updated_at2016-12-23 14:14:28.828773
descriptionPipe shell commands easily
homepagehttps://github.com/mgattozzi/pipers
repositoryhttps://github.com/mgattozzi/pipers
max_upload_size
id7745
size16,444
Michael Gattozzi (mgattozzi)

documentation

https://docs.rs/pipers/1.0.1/pipers/

README

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.

Commit count: 0

cargo fmt