Permalink
Browse files

add --map and --select support for dotted ids

  • Loading branch information...
1 parent 9e8a8b0 commit b5b15a559709eea4cfce40f2cd64e9077ec94200 @tj committed Oct 17, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 bin/jog
View
4 bin/jog
@@ -16,7 +16,7 @@ var selects = [];
// --map
program.on('map', function(val){
- if (/^\w+$/.test(val)) val = '_.' + val;
+ if (/^[\w.]+$/.test(val)) val = '_.' + val;
maps.push(new Function('_', 'return ' + val));
});
@@ -35,7 +35,7 @@ program.on('type', function(val){
// --select
program.on('select', function(val){
- if (/^\w+$/.test(val)) val = '_.' + val;
+ if (/^[\w.]+$/.test(val)) val = '_.' + val;
selects.push(new Function('_', 'return ' + val));
});

3 comments on commit b5b15a5

@cpsubrian

I think this introduced a bug. Shouldn't the regex be /^[\w\.]+$/ ?

@tj
Owner

nope, within a char class it's literal

@cpsubrian

'the more you know' ...

Please sign in to comment.