optimist
Advanced tools
Comparing version 0.1.7 to 0.1.8
15
index.js
@@ -6,3 +6,3 @@ module.exports = Argv; | ||
if (process.argv.length < 2 | ||
|| !process.argv[0].match(/(?:^|\/)node(?:-?\d+(?:\.\d+)*)?$/)) { | ||
|| !process.argv[0].match(/(?:^|\/)node(?:[^A-Za-z]|$)/)) { | ||
process.argv = ['coffee', ''].concat(process.argv); | ||
@@ -218,2 +218,15 @@ } | ||
self.camelCase = function () { | ||
for (var key in self.argv) { | ||
var camelCasedKey = key.replace(/-([a-z])/g, function ($0, firstLetter) { | ||
return firstLetter.toUpperCase(); | ||
}); | ||
if (camelCasedKey !== key) { | ||
self.argv[camelCasedKey] = self.argv[key]; | ||
delete self.argv[key]; | ||
} | ||
} | ||
return self; | ||
}; | ||
return self; | ||
@@ -220,0 +233,0 @@ }; |
{ | ||
"name" : "optimist", | ||
"version" : "0.1.7", | ||
"version" : "0.1.8", | ||
"description" : "Light-weight option parsing with an argv hash. No optstrings attached.", | ||
@@ -5,0 +5,0 @@ "main" : "./index.js", |
28366
734