From b5732bc20070c39e52bff6ebe28c7927afce836d Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 5 Oct 2017 08:49:32 -0700 Subject: [PATCH] On error, always print the error message and exit with non-zero status. --- src/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index a5c7d27333..8d7f8440ff 100644 --- a/src/main.rs +++ b/src/main.rs @@ -40,7 +40,7 @@ use std::io::stdout; use std::io::prelude::*; use docopt::Docopt; use std::path::Path; -use std::process::Command; +use std::process::{exit, Command}; use tempdir::TempDir; macro_rules! vprintln { @@ -120,9 +120,10 @@ fn main() { Ok(()) => {} Err(message) => { terminal.fg(term::color::RED).unwrap(); - vprintln!(args.flag_verbose, "error"); + println!("error"); terminal.reset().unwrap(); - vprintln!(args.flag_verbose, "{}", message) + println!("{}", message); + exit(1); } } }