txt and print output support (cli)
This commit is contained in:
parent
7478a5b305
commit
ceeede4ea5
@ -92,7 +92,7 @@ for (var i = 0; i < process.argv.length; i++) {
|
||||
|
||||
case "--output":
|
||||
var o = process.argv[++i];
|
||||
if(o == 'html' || o == 'md') conf.output = o;
|
||||
if(o == 'html' || o == 'md' || o == 'txt') conf.output = o;
|
||||
break;
|
||||
|
||||
case "--style":
|
||||
|
||||
@ -59,6 +59,7 @@
|
||||
|
||||
var data_file = "";
|
||||
var index = false;
|
||||
var print = false;
|
||||
|
||||
for (var i = 0; i < process.argv.length; i++) {
|
||||
switch(process.argv[i])
|
||||
@ -69,6 +70,11 @@ for (var i = 0; i < process.argv.length; i++) {
|
||||
case "--index":
|
||||
index = true;
|
||||
break;
|
||||
case "--print":
|
||||
print = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -103,7 +109,13 @@ for (var i = 0; i < alldata.length; i++) {
|
||||
|
||||
if(index) {
|
||||
items.sort();
|
||||
if(print) {
|
||||
_.each(items, function (i) {
|
||||
console.log('> ' + i);
|
||||
});
|
||||
} else {
|
||||
console.log(JSON.stringify(items, null, 2));
|
||||
}
|
||||
}
|
||||
|
||||
if(!index)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user