Add compiler flag to configure output coloring
This adds the flag --color, which allows the user to force coloring or turn it off. The default behavior stays the same as before (colorize, if output goes to tty). Why this is beneficial is explained in issue #12881. Please note that this commit doesn't include any regression tests. I thought about how I'd write a test for this and it doesn't seem to be worth the effort to me for a UI change like this. Fixes #12881.
This commit is contained in:
parent
579e0a5f55
commit
b7676f2df5
7 changed files with 46 additions and 12 deletions
|
@ -323,7 +323,7 @@ fn parse_crate_attrs(sess: &Session, input: &Input) ->
|
|||
}
|
||||
|
||||
pub fn early_error(msg: &str) -> ! {
|
||||
let mut emitter = diagnostic::EmitterWriter::stderr();
|
||||
let mut emitter = diagnostic::EmitterWriter::stderr(diagnostic::Auto);
|
||||
emitter.emit(None, msg, diagnostic::Fatal);
|
||||
fail!(diagnostic::FatalError);
|
||||
}
|
||||
|
@ -368,7 +368,7 @@ fn monitor(f: proc():Send) {
|
|||
Err(value) => {
|
||||
// Task failed without emitting a fatal diagnostic
|
||||
if !value.is::<diagnostic::FatalError>() {
|
||||
let mut emitter = diagnostic::EmitterWriter::stderr();
|
||||
let mut emitter = diagnostic::EmitterWriter::stderr(diagnostic::Auto);
|
||||
|
||||
// a .span_bug or .bug call has already printed what
|
||||
// it wants to print.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue