Commit c7d84375 authored by James Halliday's avatar James Halliday

usage and -h

parent 41fc8bf2
......@@ -2,9 +2,23 @@
var parse = require('../');
var concat = require('concat-stream');
var fs = require('fs');
var minimist = require('minimist');
var argv = minimist(process.argv.slice(2));
if (argv.help || argv.h) {
return fs.createReadStream(__dirname + '/usage.txt')
.pipe(process.stdout)
;
}
process.stdin.pipe(concat(function (body) {
var rows = parse(body);
if (!rows) {
console.error("couldn't parse this bundle");
process.exit(1);
}
console.log('[');
rows.forEach(function (row, index) {
if (index > 0) console.log(',');
......
usage: browser-unpack
Write a browser bundle to STDIN.
Outputs a JSON array in the module-deps format.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment