On error, always print the error message and exit with non-zero status.
This commit is contained in:
@@ -40,7 +40,7 @@ use std::io::stdout;
|
|||||||
use std::io::prelude::*;
|
use std::io::prelude::*;
|
||||||
use docopt::Docopt;
|
use docopt::Docopt;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::process::Command;
|
use std::process::{exit, Command};
|
||||||
use tempdir::TempDir;
|
use tempdir::TempDir;
|
||||||
|
|
||||||
macro_rules! vprintln {
|
macro_rules! vprintln {
|
||||||
@@ -120,9 +120,10 @@ fn main() {
|
|||||||
Ok(()) => {}
|
Ok(()) => {}
|
||||||
Err(message) => {
|
Err(message) => {
|
||||||
terminal.fg(term::color::RED).unwrap();
|
terminal.fg(term::color::RED).unwrap();
|
||||||
vprintln!(args.flag_verbose, "error");
|
println!("error");
|
||||||
terminal.reset().unwrap();
|
terminal.reset().unwrap();
|
||||||
vprintln!(args.flag_verbose, "{}", message)
|
println!("{}", message);
|
||||||
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user