git-stats/bin/git-stats
2015-01-27 12:43:47 +02:00

30 lines
724 B
JavaScript
Executable file

#!/usr/bin/env node
var GitStats = require("../lib");
switch (process.argv[2]) {
case "--record":
var data = process.argv[3].replace(/^\"|\"$/g, "");
try {
data = JSON.parse(data);
} catch (e) {
throw e;
}
GitStats.record(data, function (err) {
if (err) { throw err; }
});
break;
case "--help":
// TODO
console.log(
"git-stats"
+ "\nA GitHub-like contributions calendar, but locally, with all your git commits."
+ "\n"
);
break;
default:
GitStats.ansiCalendar(function (err, data) {
console.log(err || data);
});
break;
}