visionmedia/commander.js — pull request #70 by RyanGordon (2012-07-04 09:06:25+00:00)
Title: Required options can be bypassed

This implements a fix where it will ensure that at minimum the required options are enforced. Before, I could omit the required options and it would act like an optional option.

this.required = ~flags.indexOf('<');

these line of code were the initial problem because it will return 0 for index doesn't exist or a negative number if it does exist which isn't correct logic probably so it was changed to return a simple true or false.

Then logic was missing to ensure required options were even provided and that was added and tested