[go: up one dir, main page]

Skip to content

Commit

Permalink
优化命令
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Aug 7, 2015
1 parent d2e5266 commit 19aa9bc
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
3 changes: 1 addition & 2 deletions bin/wcj.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ program
}).on('--help', function() {
log(' basicinfo 说明:');
log();
log(' preview -b 预览基本信息');
log(' preview -e 预览教育经历');
log(' preview 预览简历');
log();
log(' -b, --basicinfo 基本信息');
log(' name : 名字');
Expand Down
35 changes: 25 additions & 10 deletions lib/resume.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function preview_basicinfo(){
log(" "+basicinfo.title)
log()
for (var a in basicinfo.data) {
log(" › " + basicinfo.data[a].info + " : " + basicinfo.data[a].val)
log(" › " + basicinfo.data[a].info + " : " + basicinfo.data[a].val)
};
log()
}
Expand All @@ -31,22 +31,37 @@ function preview_education(){
log()
}

function error_undefine(options,alias){
log()
log(" wcj:"+"'"+alias+"'"+" is not a wcj command. See 'wcj "+options._alias+" --help'.")
log()
}

module.exports = function(cmd,options) {
// console.log("IF::",cmd);
// console.log("IF::",options);
// console.log("message:123:",cmd);
// console.log("message:124:",options.basicinfo);
// console.log("message:124:",options.education);
if(cmd === "preview" && options.basicinfo === true){
if(cmd === 'preview'){
preview_basicinfo();
}else if(cmd === "preview" && options.education === true){
preview_education();
}else if(options.basicinfo){
for (var a in basicinfo.data) {
if(a === options.basicinfo) log(basicinfo.data[a].info + " : " + basicinfo.data[a].val);
};
if(options.basicinfo === true && !cmd){
preview_basicinfo();
}else if(!basicinfo.data[cmd || options.basicinfo]){
error_undefine(options,(cmd||options.basicinfo))
}else{
for (var a in basicinfo.data) {
if(cmd === a || a === options.basicinfo){
log(basicinfo.data[a].info + " : " + basicinfo.data[a].val);
}
};
}
}else if(options.education){


}
if(options.education === true && !cmd){
preview_education();
}else{
error_undefine(options,(cmd||options.education))
}
}
};

0 comments on commit 19aa9bc

Please sign in to comment.