Skip to content

Commit

Permalink
Fix missing argument validation on last option
Browse files Browse the repository at this point in the history
  • Loading branch information
sabberworm committed Mar 19, 2014
1 parent 22c7c0b commit 6dee648
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/optparse.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ OptionParser.prototype = {
if(rule.long == token || rule.short == token) {
if(rule.filter !== undefined) {
arg = tokens.shift();
if(!LONG_SWITCH_RE.test(arg) && !SHORT_SWITCH_RE.test(arg)) {
if(arg && (!LONG_SWITCH_RE.test(arg) && !SHORT_SWITCH_RE.test(arg))) {
try {
arg = rule.filter(arg);
} catch(e) {
Expand Down

0 comments on commit 6dee648

Please sign in to comment.