Exit with an error if an unknown CLI option is passed (#365)

* Exit with an error if an unknown CLI option is passed

* Only warn for unknown CLI options
master
Simon Lydell 2017-01-21 18:11:34 +01:00 committed by Christopher Chedeau
parent 4bc859b1fc
commit e4f67d8a2f
1 changed files with 6 additions and 1 deletions

View File

@ -19,7 +19,12 @@ const argv = minimist(process.argv.slice(2), {
"flow-parser"
],
string: [ "parser" ],
default: { "bracket-spacing": true, parser: "babylon" }
default: { "bracket-spacing": true, parser: "babylon" },
unknown: param => {
if (param.startsWith("-")) {
console.warn("Ignored unknown option: " + param + "\n");
}
}
});
if (argv["version"]) {