assert_contains_cli 0.1.1

very simple cli to assert a string is contained or not contained in a stream
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::env;
use std::io::{self, Read};
use std::process;

fn main() {
    let args: String = env::args().skip(1).collect::<Vec<String>>().join(" ");
    let mut buffer = String::new();
    io::stdin().read_to_string(&mut buffer).unwrap();
    if buffer.contains(&args) {
        eprintln!("error: {:?} found", args);
        process::exit(0x0100);
    }
}