Color in terminal error output

This commit is contained in:
greg 2018-03-22 03:37:48 -07:00
parent fd4f5e17df
commit 34086b3b2b

View File

@ -95,13 +95,13 @@ impl FinishedComputation {
pub fn to_repl(&self) -> String { pub fn to_repl(&self) -> String {
match self.text_output { match self.text_output {
Ok(ref s) => s.clone(), Ok(ref s) => s.clone(),
Err(ref s) => format!("Error: {}", s) Err(ref s) => format!("{} {}", "Error: ".red().bold(), s)
} }
} }
pub fn to_noninteractive(&self) -> Option<String> { pub fn to_noninteractive(&self) -> Option<String> {
match self.text_output { match self.text_output {
Ok(ref s) => None, Ok(ref s) => None,
Err(ref s) => Some(format!("Error: {}", s)), Err(ref s) => Some(format!("{} {}", "Error: ".red().bold(), s))
} }
} }
} }