apres/lit.js — pull request #1 by niallo (2012-08-01 17:58:10+00:00)
Title: Check for missing input on CLI

Before:

$ litjs

/usr/local/lib/node_modules/lit/lib/lit.js:84
for (i = 0; (section = s[i]); i++) {
^
TypeError: Cannot read property '0' of undefined
at Object.makeHtml (/usr/local/lib/node_modules/lit/lib/lit.js:84:29)
at Object. (/usr/local/lib/node_modules/lit/bin/litjs:63:41)
at Module._compile (module.js:446:26)
at Object..js (module.js:464:10)
at Module.load (module.js:353:31)
at Function._load (module.js:311:12)
at Array.0 (module.js:484:10)
at EventEmitter._tickCallback (node.js:190:38)

After:

$ bin/litjs
Error: Input data required.
Create annotated web page from JS source

Usage: node ./bin/litjs [infile]

Options:
-t, --template HTML template file name, defaults to columns.html
-o, --out Output file, defaults to stdout
--title Title for output page, defaults to input file name
--style, -s Page style, one of "columns", "callouts", or "stacked" [default: "columns"]