5 * Copyright (c) 2016 Tyler Kellen, contributors
6 * Licensed under the MIT license.
7 * https://github.com/gruntjs/grunt-init/blob/master/LICENSE-MIT
13 var nopt = require('nopt');
14 var gruntOptions = require('grunt-known-options');
16 // Parse `gruntOptions` into a form that nopt can handle.
20 Object.keys(gruntOptions).forEach(function(key) {
21 var short = gruntOptions[key].short;
23 exports.aliases[short] = '--' + key;
25 exports.known[key] = gruntOptions[key].type;
28 // Parse them and return an options object.
29 Object.defineProperty(exports, 'options', {
31 return nopt(exports.known, exports.aliases, process.argv, 2);