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; 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) { 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) { diff --git a/package.json b/package.json index 6f87ab35..37b5132b 100644 --- a/package.json +++ b/package.json @@ -58,10 +58,10 @@ "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" + "wrap-ansi": "^2.0.0", + "yargs-parser": "^10.1.0" }, "engines": { "node": ">= 0.10.0",