gitnu 0.0.5

gitnu indexes your git status so you can use numbers instead of filenames.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::io::Error;
use std::process::{Command, Output};

pub fn get_stdout(cmd: &mut Command) -> Result<String, Error> {
    let trim_out = |p: Output| {
        let mut s = String::from(String::from_utf8_lossy(&p.stdout));
        while s.ends_with('\n') || s.ends_with('\r') {
            s.pop();
        }
        Ok(s)
    };
    match cmd.output() {
        Ok(p) => return trim_out(p),
        Err(e) => return Err(e),
    };
}