aboutsummaryrefslogtreecommitdiff
path: root/lib/compilers/argument-parsers.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/compilers/argument-parsers.js')
-rw-r--r--lib/compilers/argument-parsers.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/compilers/argument-parsers.js b/lib/compilers/argument-parsers.js
index fe4e242c9..abd967471 100644
--- a/lib/compilers/argument-parsers.js
+++ b/lib/compilers/argument-parsers.js
@@ -255,21 +255,27 @@ 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(results => {
+ const options = _.extend.apply(_.extend, results);
+ if (BaseParser.hasSupport(options, "--color")) {
+ if (compiler.compiler.options) compiler.compiler.options += " ";
+ compiler.compiler.options += "--color=always";
+ }
return compiler;
});
}
static getOptions(compiler, helpArg) {
- return compiler.execCompilerCached(compiler.compiler.exe, [helpArg]).then(result => {
+ return compiler.execCompilerCached(compiler.compiler.exe, helpArg.split(' ')).then(result => {
let options = {};
if (result.code === 0) {
if (helpArg === "-C help") {
const optionFinder = /^\s*(-C\s*[a-z0-9=-]*)\s--\s(.*)/i;
options = BaseParser.parseLines(result.stdout + result.stderr, optionFinder);
- } else if (helpArg === "--help") {
+ } else {
const optionFinder = /^\s*(--?[a-z0-9=+,[\]<>|-]*)\s*(.*)/i;
options = BaseParser.parseLines(result.stdout + result.stderr, optionFinder);