From 30e8885a0f73e78abf3c135a346cdf2c87750c51 Mon Sep 17 00:00:00 2001 From: Peter Cottle Date: Sun, 21 Oct 2012 00:11:59 -0700 Subject: [PATCH] more quote stuff thanks nikita --- src/commandModel.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/commandModel.js b/src/commandModel.js index a20910b7..9b1fd9bb 100644 --- a/src/commandModel.js +++ b/src/commandModel.js @@ -269,14 +269,9 @@ OptionParser.prototype.getMasterOptionMap = function() { }; OptionParser.prototype.explodeAndSet = function() { - // split on spaces, except when inside quotes, and strip quotes after. - // for some reason the regex includes the quotes even if i move the parantheses - // inside + // split on spaces, except when inside quotes + var exploded = this.rawOptions.match(/('.*?'|".*?"|\S+)/g) || []; - _.each(exploded, function(part, i) { - exploded[i] = part.replace(/^['"]|['"]$/g, ''); - console.log(exploded[i]); - }); for (var i = 0; i < exploded.length; i++) { var part = exploded[i];