diff options
author | RabsRincon <ruben@rinconblanco.es> | 2019-12-27 16:50:33 +0100 |
---|---|---|
committer | RabsRincon <ruben@rinconblanco.es> | 2019-12-27 16:50:33 +0100 |
commit | 21bf3b235dd8992e20ff3f15d8baafcc9db73eb9 (patch) | |
tree | 7df14576643e9e165d0b796c89913031f7326e6b /lib/compilers/argument-parsers.js | |
parent | 19244b9323f83526acf13c7d6d00cf5bc7a41e2e (diff) | |
download | compiler-explorer-21bf3b235dd8992e20ff3f15d8baafcc9db73eb9.tar.gz compiler-explorer-21bf3b235dd8992e20ff3f15d8baafcc9db73eb9.zip |
Add colored output to Rust compilers if supported
As requested in #1755
Diffstat (limited to 'lib/compilers/argument-parsers.js')
-rw-r--r-- | lib/compilers/argument-parsers.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/compilers/argument-parsers.js b/lib/compilers/argument-parsers.js index 383aa2aa7..d04e243e8 100644 --- a/lib/compilers/argument-parsers.js +++ b/lib/compilers/argument-parsers.js @@ -255,8 +255,13 @@ class RustParser extends BaseParser { static parse(compiler) { return Promise.all([ RustParser.getOptions(compiler, "--help"), - RustParser.getOptions(compiler, "-C help") - ]).then(() => { + RustParser.getOptions(compiler, "-C help"), + RustParser.getOptions(compiler, "--help -v") + ]).then(options => { + if (BaseParser.hasSupport(options, "--color")) { + if (compiler.compiler.options) compiler.compiler.options += " "; + compiler.compiler.options += "--color=always"; + } return compiler; }); } |