From 462a931c29ef32e997bd0f5e224661898713dce4 Mon Sep 17 00:00:00 2001 From: zyuhel Date: Fri, 27 Jul 2018 02:15:33 +0300 Subject: [PATCH 1/5] Change minist to yargs-parser --- lib/util.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/util.js b/lib/util.js index e16fb4e9..98c31e65 100755 --- a/lib/util.js +++ b/lib/util.js @@ -5,7 +5,7 @@ */ const _ = require('lodash'); -const minimist = require('minimist'); +const argParser = require('yargs-parser'); const strip = require('strip-ansi'); const util = { @@ -30,7 +30,7 @@ const util = { } } while (match !== null); - arr = minimist(arr, opts); + arr = argParser(arr, opts); arr._ = arr._ || []; return arr; }, @@ -212,9 +212,11 @@ const util = { } // Types are custom arg types passed - // into `minimist` as per its docs. + // into `argParser` as per its docs. const types = cmd._types || {}; - + types.configuration = { + "camel-case-expansion": false + } // Make a list of all boolean options // registered for this command. These are // simply commands that don't have required @@ -252,7 +254,7 @@ const util = { return match; }); - // Use minimist to parse the args. + // Use argParser to parse the args. const parsedArgs = this.parseArgs(passedArgs, types); function validateArg(arg, cmdArg) { From a90b5b27f30e72125033c60e44ea244a1a0052ab Mon Sep 17 00:00:00 2001 From: zyuhel Date: Fri, 27 Jul 2018 02:16:49 +0300 Subject: [PATCH 2/5] Add yargs-parser as dependency --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 6f87ab35..4d181f7d 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,8 @@ "minimist": "^1.2.0", "node-localstorage": "^0.6.0", "strip-ansi": "^3.0.0", - "wrap-ansi": "^2.0.0" + "wrap-ansi": "^2.0.0", + "yargs-parser": "^10.1.0" }, "engines": { "node": ">= 0.10.0", From 1f2740a51e02dfdcd75c2e8b5469f13e31b2b12f Mon Sep 17 00:00:00 2001 From: zyuhel Date: Fri, 27 Jul 2018 13:20:16 +0300 Subject: [PATCH 3/5] Update util.js --- dist/util.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/dist/util.js b/dist/util.js index d527c9e6..1ea1d9fc 100755 --- a/dist/util.js +++ b/dist/util.js @@ -7,7 +7,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _ = require('lodash'); -var minimist = require('minimist'); +const argParser = require('yargs-parser'); var strip = require('strip-ansi'); var util = { @@ -32,7 +32,7 @@ var util = { } } while (match !== null); - arr = minimist(arr, opts); + arr = argParser(arr, opts); arr._ = arr._ || []; return arr; }, @@ -216,8 +216,11 @@ var util = { } // Types are custom arg types passed - // into `minimist` as per its docs. + // into `argParser` as per its docs. var types = cmd._types || {}; + types.configuration = { + "camel-case-expansion": false + } // Make a list of all boolean options // registered for this command. These are @@ -256,7 +259,7 @@ var util = { return match; }); - // Use minimist to parse the args. + // Use argParser to parse the args. var parsedArgs = this.parseArgs(passedArgs, types); function validateArg(arg, cmdArg) { @@ -461,4 +464,4 @@ var util = { * Expose `util`. */ -module.exports = exports = util; \ No newline at end of file +module.exports = exports = util; From 9678c7a58245c2ae5fbf5e40439986486e486d15 Mon Sep 17 00:00:00 2001 From: zyuhel Date: Fri, 17 Aug 2018 22:16:28 +0300 Subject: [PATCH 4/5] remove minimist from dependencies --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 4d181f7d..37b5132b 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,6 @@ "inquirer": "0.11.0", "lodash": "^4.5.1", "log-update": "^1.0.2", - "minimist": "^1.2.0", "node-localstorage": "^0.6.0", "strip-ansi": "^3.0.0", "wrap-ansi": "^2.0.0", From 5a8aee1029a5609f82284075af8c9c94b6cf67ca Mon Sep 17 00:00:00 2001 From: zyuhel Date: Tue, 25 Sep 2018 18:26:51 +0300 Subject: [PATCH 5/5] Change minimist to args-parser --- lib/vorpal.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/vorpal.js b/lib/vorpal.js index f4a08819..28689c7b 100755 --- a/lib/vorpal.js +++ b/lib/vorpal.js @@ -22,7 +22,7 @@ var VorpalUtil = require('./util'); var ui = require('./ui'); var Session = require('./session'); var intercept = require('./intercept'); -var minimist = require('minimist'); +var argParser = require('yargs-parser'); var commons = require('./vorpal-commons'); var chalk = require('chalk'); var os = require('os'); @@ -161,7 +161,7 @@ Vorpal.prototype.parse = function (argv, options) { args.shift(); if (args.length > 0 || catchExists) { if (options.use === 'minimist') { - result = minimist(args); + result = argParser(args); } else { // Wrap the spaced args back in quotes. for (let i = 0; i < args.length; ++i) {