lipsum-cli 0.3.0

Terminal application for generating lipsum text. Default usage will generate a string like `Grate Meminit et Praesentibus` using `Liber Primus` which should be suitable for use in a document title.
use std::fs::File;
use std::io::{self, Read};

pub fn read_from_stdin() -> String {
    let mut input = String::new();
    loop {
        match io::stdin().read_line(&mut input) {
            Ok(len) => if len == 0 {
                break;
            }
            Err(error) => {
                eprintln!("error: {}", error);
                break;
            }
        }
    }
    input
}

pub fn read_from_file(file: &str) -> String {
    let mut input = String::new();
    let mut f = File::open(file).expect("File not found!");
    f.read_to_string(&mut input).expect("Something went wrong reading the file!");
    input
}