substack/node-optimist — pull request #65 by 13k (2012-08-02 03:29:20+00:00)
Title: optimist fails to compile using Closure Compiler

As we can see [here](https://gist.github.com/3232733), closure compiler fails when trying to compile optimist, mainly because it doesn't pass Lint tests.

Fatal errors were:

* `boolean` is a language keyword, used as a method on the argv object
* `default` is language keyword, used as a method on the argv object trailing
* commas in arrays fails on internet explorer (we don't really give a shit, but it's fatal for the compiler)

This proposed fix does:

* renames `boolean` to `bool`, just a common shorter version
* renames `default` to `defaults`, makes sense at least because it can accept multiple default definitions passing an object
* removes such trailing commas

I think the renames are necessary (as opposed to simply doing `self["boolean"] = ...`) because it would force the users of the library to write non-Lint'able code.

Options passed to .options() stayed the same.

Tests are updated and passing.

Of course this breaks API, so this PR is kinda just a heads up, you'd probably want to decide or even code it better.