Permalink
Browse files

add word support to --map and --select

for example
$ jog --file my.log --map name

vs

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

0 comments on commit c065776

Please sign in to comment.