Skip to content

Commit

Permalink
(api) '-m' and '-r' now require a space between pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudhead committed Jun 17, 2010
1 parent 82f6e5e commit 7ed9f65
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/vows
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ while (arg = argv.shift()) {
arg = arg.match(/^--?(.+)/)[1];

if (arg[0] === 'r') {
options.matcher = new(RegExp)(arg.slice(1));
options.matcher = new(RegExp)(argv.shift());
} else if (arg[0] === 'm') {
options.matcher = (function (str) { // Create an escaped RegExp
var specials = '. * + ? | ( ) [ ] { } \\ ^ ? ! = : $'.split(' ').join('|\\'),
regex = new(RegExp)('(\\' + specials + ')', 'g');
return new(RegExp)(str.replace(regex, '\\$1'));
})(arg.slice(1));
})(argv.shift());
} else if (arg in options) {
options[arg] = true;
} else {
Expand Down

0 comments on commit 7ed9f65

Please sign in to comment.