Crate read_pipe

Source
Expand description

§read_pipe

Simple Rust crate to read pipes from stdin.

§Usage

if let Some(pipe) = read_pipe::read_pipe() {
    println!("User has piped \"{pipe}\" to the program.")
}

§Examples


Input:

echo "Really interesting pipe" | cargo run

Output:

Some("Really interesting pipe")

Input:

cargo run

Output:

None

Functions§

read_pipe
Reads a pipe from stdin and returns it as a String.
read_pipe_split_whitespace
Reads pipe from stdin, splits it by whitespace and returns it as a Vec<String>.