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
|
|
@ -78,7 +78,7 @@ fn get_ast_and_resolve(cpath: &Path, libs: HashSet<Path>, cfgs: Vec<StrBuf>)
|
|||
|
||||
|
||||
let codemap = syntax::codemap::CodeMap::new();
|
||||
let diagnostic_handler = syntax::diagnostic::default_handler();
|
||||
let diagnostic_handler = syntax::diagnostic::default_handler(syntax::diagnostic::Auto);
|
||||
let span_diagnostic_handler =
|
||||
syntax::diagnostic::mk_span_handler(diagnostic_handler, codemap);
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ pub fn run(input: &str,
|
|||
|
||||
|
||||
let codemap = CodeMap::new();
|
||||
let diagnostic_handler = diagnostic::default_handler();
|
||||
let diagnostic_handler = diagnostic::default_handler(diagnostic::Auto);
|
||||
let span_diagnostic_handler =
|
||||
diagnostic::mk_span_handler(diagnostic_handler, codemap);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue