argsparser
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -17,3 +17,3 @@ /** | ||
// its a switch | ||
if (/^-|--/.test(arg)) { | ||
if (/^(-|--)/.test(arg)) { | ||
opts[arg] = true; | ||
@@ -20,0 +20,0 @@ curSwitch = arg; |
{ | ||
"name": "argsparser", | ||
"description": "A tiny command line arguments parser", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"author": "Oleg Slobodskoi <oleg008@gmail.com>", | ||
@@ -21,2 +21,2 @@ "repository": { | ||
] | ||
} | ||
} |
@@ -17,2 +17,4 @@ var a = require('assert'), | ||
a.deepEqual(parse(['--token', 'bla--bla']), {'--token': 'bla--bla'}, 'node script.js --token bla--bla'); | ||
a.deepEqual(parse(['-o', '123.456']), {'-o': 123.456}, 'node script.js -o 123.456'); | ||
@@ -36,3 +38,2 @@ | ||
util.print('All tests ok\n'); |
4918
6
61