mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2025-05-15 10:07:07 +01:00
Introduce PEEK command.
Peek at arbitrary resumes and resume objects paths with "hackmyresume peek <resume> [objectPath]". For ex: hackmyresume PEEK resume.json hackmyresume PEEK resume.json info hackmyresume PEEK resume.json employment[2].keywords hackmyresume PEEK r1.json r2.json r3.json info.brief
This commit is contained in:
@ -22,7 +22,6 @@ Definition of the `main` function.
|
||||
, StringUtils = require('../utils/string.js')
|
||||
, _ = require('underscore')
|
||||
, OUTPUT = require('./out')
|
||||
, SAFELOADJSON = require('../utils/safe-json-loader')
|
||||
, PAD = require('string-padding')
|
||||
, Command = require('commander').Command;
|
||||
|
||||
@ -93,6 +92,15 @@ Definition of the `main` function.
|
||||
execute.call( this, sources, [], this.opts(), logMsg);
|
||||
});
|
||||
|
||||
// Create the PEEK command
|
||||
program
|
||||
.command('peek')
|
||||
.arguments('<sources...>')
|
||||
.description('Peek at a resume field or section')
|
||||
.action(function( sources, sectionOrField ) {
|
||||
execute.call( this, sources, [ sources.pop() ], this.opts(), logMsg);
|
||||
});
|
||||
|
||||
// Create the BUILD command
|
||||
program
|
||||
.command('build')
|
||||
@ -189,7 +197,8 @@ Definition of the `main` function.
|
||||
if( optStr[0] === '{')
|
||||
oJSON = eval('(' + optStr + ')'); // jshint ignore:line
|
||||
else {
|
||||
oJSON = SAFELOADJSON( optStr );
|
||||
oJSON = safeLoadJSON( optStr );
|
||||
// TODO: Error handling
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user