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
|
@ -13,7 +13,7 @@
|
|||
|
||||
use ast;
|
||||
use codemap::{Span, CodeMap, FileMap};
|
||||
use diagnostic::{SpanHandler, mk_span_handler, default_handler};
|
||||
use diagnostic::{SpanHandler, mk_span_handler, default_handler, Auto};
|
||||
use parse::attr::ParserAttr;
|
||||
use parse::parser::Parser;
|
||||
|
||||
|
@ -41,7 +41,7 @@ pub struct ParseSess {
|
|||
|
||||
pub fn new_parse_sess() -> ParseSess {
|
||||
ParseSess {
|
||||
span_diagnostic: mk_span_handler(default_handler(), CodeMap::new()),
|
||||
span_diagnostic: mk_span_handler(default_handler(Auto), CodeMap::new()),
|
||||
included_mod_stack: RefCell::new(Vec::new()),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue