jfd/optparse-js — pull request #16 by sabberworm (2014-03-19 11:45:40+00:00)
Title: Reset arg if it was a switch and not an argument

The following:

var parser = new OptionParser([['-e', '--example [STRING]']]);
parser.parse(['--example', '--help']);

would pass `"--help" as arg to the `example` handler.

Note: merging this will most likely conflict with pull request #14. Ultimately it should not make much difference whether you put the `arg = undefined;` inside or below the `if` block.