yeoman/generator — pull request #398 by nwinkler (2013-11-08 18:41:14+00:00)
Title: Help improvements

Previously, running something like `yo angular:directive --help` would only show an error due to the missing required _name_ argument. This was not very helpful for the user.

I’ve changed this so that when providing the help option, the required arguments are added, but no error is raised if a required argument is not provided. This results in a clean and consistent handling of the help option. Now when running `yo angular:directive --help`, the standard help/usage screen is shown, listing the options and arguments.

In addition to that, I’ve enhanced the help/usage function to list the arguments both in the usage line and also as an additional table similar to the options table. Let me know if that format looks good, I tried to keep it similar to the format used by the options.

As a byproduct, I had to add the _namespace_ to the _options_ object in `env.create`, since it’s used for displaying the correct name of the generator in the usage line. With the previous version, a call to `yo angular:directive --help` resulted in the usage line `yo directive`. Using the namespace in this place ensures that the correct name is displayed in the usage line: `yo angular:directive`.