Allows additional command line options to be properly registered using nopt along with those natively supported by grunt.
Install
$ npm install nopt-grunt
Example
Grunt is awesome. Grunt's support for using additional command line options is not awesome. The current documentation is misleading in that they give examples of using boolean flags and options with values, but they don't tell you that it only works that way with a single option. Try and use more than one option and things fall apart quickly.
// Gruntfile.js -> grunt --foomodule { assert; // pass grunt;}; // Gruntfile.js -> grunt --bar=42module { assert; // pass grunt;}; // Gruntfile.js -> grunt --foo --bar=42module { assert; // fail -> foo === '--bar=42' assert; // fail -> bar === undefined grunt;};
Not helpful. Back to the documentation! Still not helpful. Enter nopt-grunt
.
// Gruntfile.js -> grunt --foo --bar=42module { // require it at the top and pass in the grunt instance grunt; // new method now available grunt; assert; // pass! assert; // pass! // reference values as before grunt; grunt; grunt;};
License
MIT