Comparing version 1.0.2 to 1.0.3
@@ -1,5 +0,7 @@ | ||
var Parameter, REGEX_OPTIONAL, REGEX_REQUIRED, REGEX_VARIADIC, parse, _; | ||
var Parameter, REGEX_MULTIWORD, REGEX_OPTIONAL, REGEX_REQUIRED, REGEX_VARIADIC, parse, _; | ||
_ = require('lodash'); | ||
_.str = require('underscore.string'); | ||
parse = require('./parse'); | ||
@@ -13,2 +15,4 @@ | ||
REGEX_MULTIWORD = /\s/; | ||
module.exports = Parameter = (function() { | ||
@@ -42,2 +46,6 @@ function Parameter(parameter) { | ||
Parameter.prototype.isMultiWord = function() { | ||
return this._testRegex(REGEX_MULTIWORD); | ||
}; | ||
Parameter.prototype.getValue = function() { | ||
@@ -92,2 +100,5 @@ var regex, result; | ||
Parameter.prototype.toString = function() { | ||
if (this.isMultiWord() && this.isWord()) { | ||
return _.str.quote(this.parameter); | ||
} | ||
return this.parameter; | ||
@@ -94,0 +105,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
var minimist, settings, state, _; | ||
var Parameter, minimist, settings, state, _; | ||
@@ -13,2 +13,4 @@ _ = require('lodash'); | ||
Parameter = require('./parameter'); | ||
exports.normalizeInput = function(argv) { | ||
@@ -37,6 +39,5 @@ if (argv === process.argv) { | ||
output._ = _.map(output._, function(word) { | ||
if (/\s/.test(word)) { | ||
word = _.str.quote(word); | ||
} | ||
return word; | ||
var wordParameter; | ||
wordParameter = new Parameter(word); | ||
return wordParameter.toString(); | ||
}); | ||
@@ -43,0 +44,0 @@ result.command = output._.join(' '); |
{ | ||
"name": "capitano", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Powerful, non opitionated command line parser for serious applications", | ||
@@ -5,0 +5,0 @@ "main": "build/capitano.js", |
@@ -326,2 +326,6 @@ Capitano | ||
### 1.0.3 | ||
- Fix issue with quotation of multi word parameters. Thanks [@Page-](https://github.com/Page-)! | ||
### 1.0.2 | ||
@@ -328,0 +332,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
95229
583
364