From 98a5d5fe1ee50eca139ff51aeb296ee57d32ae06 Mon Sep 17 00:00:00 2001 From: Anton Usmansky Date: Thu, 7 Dec 2017 11:59:26 +0300 Subject: [PATCH] fix: allow unknown options before parsing config file --- lib/cli/index.js | 5 +++-- package-lock.json | 16 +++++++++++----- package.json | 2 +- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/lib/cli/index.js b/lib/cli/index.js index 09ec75854..732f722aa 100644 --- a/lib/cli/index.js +++ b/lib/cli/index.js @@ -16,6 +16,7 @@ exports.run = () => { program .version(pkg.version) + .allowUnknownOption() .option('-c, --config ', 'config file'); const configPath = preparseOption(program, 'config'); @@ -26,14 +27,14 @@ exports.run = () => { .option('--grep ', 'run only suites matching the pattern', RegExp); program.command('update [paths...]') - .allowUnknownOption(true) + .allowUnknownOption() .option('--diff', 'update only screenshots with diff') .option('--new', 'save only new screenshots') .description('update the changed screenshots or gather if they doesn\'t exist') .action((paths, options) => mkRunFn(gemini, 'update', program)(paths, options).done()); program.command('test [paths...]') - .allowUnknownOption(true) + .allowUnknownOption() .option('-r, --reporter ', 'test result reporter (flat by default)', collect) .option('-s, --set ', 'set to run', collect) .description('run tests') diff --git a/package-lock.json b/package-lock.json index 8b716e7e3..6993b0e39 100644 --- a/package-lock.json +++ b/package-lock.json @@ -855,9 +855,9 @@ } }, "commander": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", - "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==" + "version": "2.12.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.12.2.tgz", + "integrity": "sha512-BFnaq5ZOGcDN7FlrtBT4xxkgIToalIIxwjxLWVJ8bGTpe1LroqMiqQXdA7ygc7CRvaYS+9zfPGFnJqFSayx+AA==" }, "compare-func": { "version": "1.3.2", @@ -1315,7 +1315,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "commander": "2.11.0", + "commander": "2.12.2", "is-my-json-valid": "2.16.1", "pinkie-promise": "2.0.1" } @@ -2521,6 +2521,12 @@ "user-home": "2.0.0" }, "dependencies": { + "commander": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", + "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", + "dev": true + }, "fs-extra": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-3.0.1.tgz", @@ -2705,7 +2711,7 @@ "requires": { "bluebird": "2.11.0", "chalk": "1.1.3", - "commander": "2.11.0", + "commander": "2.12.2", "is-my-json-valid": "2.16.1" }, "dependencies": { diff --git a/package.json b/package.json index e2342ee7f..3c9228c41 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "bluebird": "^3.4.6", "browserify": "^13.0.0", "chalk": "^1.1.3", - "commander": "^2.8.1", + "commander": "^2.12.2", "css": "^2.1.0", "debug": "^2.2.0", "fs-extra": "^0.30.0",