[go: up one dir, main page]

Skip to content

Commit

Permalink
简历添加“IT技能”输出
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Aug 9, 2015
1 parent 340e37a commit 14ac8ac
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 22 deletions.
24 changes: 7 additions & 17 deletions bin/wcj.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
var program = require('commander');
var appInfo = require('./../package.json');
var resume = require('../lib/resume.js');
var info = require('./../lib/info.json');
var basicinfo = info.basicinfo;//基本信息数据:
var log = console.log;

program
Expand All @@ -15,6 +17,7 @@ program
.description(' 这里是我的简历详情!')
.option("-b, --basicinfo [type]", "基本信息")
.option("-e, --education [type]", "教育经历")
.option("-i, --itskill [type]", "IT技能")
.action(function(cmd, options){
var nm = typeof options.name=='string'?options.name:""
// log('resume "%s" 使用 %s 模式', cmd, nm);
Expand All @@ -27,24 +30,11 @@ program
log(' preview 预览简历');
log();
log(' -b, --basicinfo 基本信息');
log(' name : 名字');
log(' height : 身高');
log(' dateOfBirth : 出生日期');
log(' workExperience : 工作经验');
log(' mobile : 手机号码');
log(' telephone : 电话号码');
log(' email : 邮箱地址');
log(' residency : 居住地点');
log(' currentSituation : 现状');
log(' currentCity : 当前城市');
log(' nation : 国家');
log(' region : 地区');
log(' postalCode : 邮编地址');
log(' ID : 身份证ID');
log(' website : 个人网赚');
log(' maritalStatus : 婚姻状况');
log(' politicalStatus : 政治面貌');
for (var a in basicinfo.data) {
log(" "+ a + ': ' + basicinfo.data[a].info)
};
log(' -e, --education 教育经历');
log(' -i, --itskill 教育经历');
// log(' $ wcj resume ss');
log();
});
Expand Down
68 changes: 63 additions & 5 deletions lib/resume.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,36 @@ var log = console.log;
var info = require('./../lib/info.json');
var basicinfo = info.basicinfo;//基本信息数据:
var education = info.education;//教育经历数据:
var itskill = info.itskill;//教育经历数据:

//基本信息 预览
function preview_basicinfo(){
var dt = basicinfo.data
log()
log(" "+basicinfo.title)
log(" "+ basicinfo.title + ': ' +(dt.name.val||'') )
log()
for (var a in basicinfo.data) {
log(" › " + basicinfo.data[a].info + " : " + basicinfo.data[a].val)
};
log(" " + (dt.workExperience?dt.workExperience.val + '|' :'') +
(dt.gender?dt.gender.val + '|' :'') +
(dt.dateOfBirth?dt.dateOfBirth.val + '|' :'') +
(dt.maritalStatus?dt.maritalStatus.val + '|' :'') +
(dt.height?dt.height.val :'') )

log(" ----------------------------");
if(dt.hukou)log(" " + dt.hukou.info + " : " + dt.hukou.val);
if(dt.residency)log(" " + dt.residency.info + " : " + dt.residency.val);
if(dt.nation || dt.region || dt.currentCity || dt.postalCode){
var address = '' + (dt.nation.val||'') + ' ' +
(dt.currentCity.val || '') + ' ' +
(dt.postalCode.val?' (邮编: '+dt.postalCode.val+')':'');

log(" 地 址 : "+ address);
}
if(dt.mobile)log(" " + dt.mobile.info + " : " + dt.mobile.val);
if(dt.email)log(" " + dt.email.info + " : " + dt.email.val);
if(dt.website)log(" " + dt.website.info + " : " + dt.website.val);
log()
}

//教育经历 预览
function preview_education(){
var edu = education.data;
log()
Expand All @@ -31,6 +50,29 @@ function preview_education(){
log()
}

//IT技能 预览
function preview_itskill(){
var its = itskill.data;
log()
log(" "+itskill.title)
log()
for (var i = 0; i < its.length; i++) {

var txt = ''

for(var a in its[i]){
if(its[i][a]) {
txt += a + ':' + its[i][a] + ' | ';
// log(" ■ " + (its[i][a]? a + ':' + its[i][a]:"") )
}
}
log(" ■ " + txt)
// log(" ----------------------------");
};
log()
}

//错误处理
function error_undefine(options,alias){
log()
log(" wcj:"+"'"+alias+"'"+" is not a wcj command. See 'wcj "+options._alias+" --help'.")
Expand All @@ -43,9 +85,12 @@ module.exports = function(cmd,options) {
// console.log("message:124:",options.basicinfo);
// console.log("message:124:",options.education);
if(cmd === 'preview'){
//提供可选参数预览简历
preview_basicinfo();
preview_education();
preview_itskill();
}else if(options.basicinfo){
//基本信息
if(options.basicinfo === true && !cmd){
preview_basicinfo();
}else if(!basicinfo.data[cmd || options.basicinfo]){
Expand All @@ -58,10 +103,23 @@ module.exports = function(cmd,options) {
};
}
}else if(options.education){
//教育经历预览
if(options.education === true && !cmd){
preview_education();
}else{
error_undefine(options,(cmd||options.education))
}
}else if(options.itskill){
//IT技能 预览
if(options.itskill === true && !cmd){
preview_itskill();
}else{
error_undefine(options,(cmd||options.itskill))
}
}else{
//如果没有任何参数就是预览简历
preview_basicinfo();
preview_education();
preview_itskill();
}
};

0 comments on commit 14ac8ac

Please sign in to comment.