github-markdown-css/cli.js
Sindre Sorhus 4c84b3ca10 init
2014-05-07 20:25:28 +02:00

31 lines
611 B
JavaScript
Executable File

#!/usr/bin/env node
'use strict';
var pkg = require('./package.json');
var githubMarkdownCss = require('./index');
var input = process.argv[2];
function help() {
console.log(pkg.description);
console.log('');
console.log('Usage');
console.log(' $ github-markdown-css > <filename>');
}
if (process.argv.indexOf('-h') !== -1 || process.argv.indexOf('--help') !== -1) {
help();
return;
}
if (process.argv.indexOf('-v') !== -1 || process.argv.indexOf('--version') !== -1) {
console.log(pkg.version);
return;
}
githubMarkdownCss(function (err, css) {
if (err) {
throw err;
}
console.log(css);
});