yeoman/generator — pull request #524 by jridgewell (2014-04-03 21:31:49+00:00)
Title: Allow Options in Generator

Allow generators to easily get their options from the command line. This is done by calling `#parseOptions()`, after any/all `#option('name', {})` calls.

`#parseOptions()` will take the "private" `_args` and add all the generator's options to the `options` object. I introduced `_args` so that `#parseOptions` can be called multiple times without causing any destructive information (since `args` and `arguments` are overridden).

Supports nopt's short hands using the `alias` key of an option.

Depends upon getting the full arguments from the yo cli, not just the remaining arguments.
https://github.com/yeoman/yo/blob/37ae024f0105311945c98aef7a369f450d71fe9c/cli.js#L20

Should fix https://github.com/yeoman/generator/issues/386, now that options are defaulted to `undefined`.