more quote stuff thanks nikita

This commit is contained in:
Peter Cottle 2012-10-21 00:11:59 -07:00
parent 46632988cf
commit 30e8885a0f

View file

@ -269,14 +269,9 @@ OptionParser.prototype.getMasterOptionMap = function() {
}; };
OptionParser.prototype.explodeAndSet = function() { OptionParser.prototype.explodeAndSet = function() {
// split on spaces, except when inside quotes, and strip quotes after. // split on spaces, except when inside quotes
// for some reason the regex includes the quotes even if i move the parantheses
// inside
var exploded = this.rawOptions.match(/('.*?'|".*?"|\S+)/g) || []; 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++) { for (var i = 0; i < exploded.length; i++) {
var part = exploded[i]; var part = exploded[i];