gps 7.3.3

Official CLI & library for Git Patch Stack
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use ansi_term::Colour::Red;

pub fn print_err(color: bool, message: &str) {
    if color {
        eprintln!("{}", Red.paint(message))
    } else {
        eprintln!("{}", message)
    }
}

pub fn print_error_chain(color: bool, e: Box<dyn std::error::Error>) {
    print_err(color, &format!("\nError: {}\n", e));
    let mut err = e.source();
    while let Some(e) = err {
        print_err(color, &format!("Caused by: {}\n", e));
        err = e.source();
    }
}