From 8d7cf329886ad5bd529b2558edc9784198c83ed0 Mon Sep 17 00:00:00 2001 From: hacksalot Date: Sun, 3 Jan 2016 03:18:56 -0500 Subject: [PATCH] Finish Commander.js integration. --- src/core/fresh-resume.js | 8 ++++ src/core/jrs-resume.js | 10 +++++ src/core/resume-factory.js | 1 + src/index.js | 82 ++++++++++++++++---------------------- src/verbs/generate.js | 4 +- 5 files changed, 56 insertions(+), 49 deletions(-) diff --git a/src/core/fresh-resume.js b/src/core/fresh-resume.js index 280d603..1ab8833 100644 --- a/src/core/fresh-resume.js +++ b/src/core/fresh-resume.js @@ -208,6 +208,14 @@ Definition of the FRESHResume class. return this.parseJSON( JSON.parse( stringData ), opts ); }; + /** + Return internal metadata. Create if it doesn't exist. + */ + FreshResume.prototype.imp = function() { + this.imp = (this.imp || { }); + return this.imp; + }; + /** Return a unique list of all keywords across all skills. */ diff --git a/src/core/jrs-resume.js b/src/core/jrs-resume.js index 5609a75..0c5a862 100644 --- a/src/core/jrs-resume.js +++ b/src/core/jrs-resume.js @@ -136,6 +136,16 @@ Definition of the JRSResume class. return flatSkills; }; + /** + Return internal metadata. Create if it doesn't exist. + JSON Resume v0.0.0 doesn't allow additional properties at the root level, + so tuck this into the .basic sub-object. + */ + JRSResume.prototype.imp = function() { + this.basics = this.basics || { imp: { } }; + return this.basics; + }; + /** Reset the sheet to an empty state. */ diff --git a/src/core/resume-factory.js b/src/core/resume-factory.js index 025ca1f..e9351b3 100644 --- a/src/core/resume-factory.js +++ b/src/core/resume-factory.js @@ -75,6 +75,7 @@ Definition of the ResumeFactory class. if( objectify ) { var ResumeClass = require('../core/' + (toFormat || orgFormat) + '-resume'); rez = new ResumeClass().parseJSON( json ); + rez.imp().file = src; } return { diff --git a/src/index.js b/src/index.js index 90d8718..b8244c0 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,7 @@ #! /usr/bin/env node + + /** Command-line interface (CLI) for HackMyResume. @license MIT. Copyright (c) 2015 hacksalot (https://github.com/hacksalot) @@ -90,12 +92,13 @@ function main() { .alias('generate') //.arguments(' TO [targets]') //.usage('...') - .option('-t --theme ', 'Theme name or path') - .option('-p --prettify', 'Preffity HTML output.') + .option('-t --theme ', 'Theme name or path', 'modern') + .option('-p --prettify', 'Preffity HTML output', true) + .option('-c --css