Security update for Core, with self-updated composer
[yaffs-website] / node_modules / grunt / node_modules / grunt-cli / lib / cli.js
1 /*
2  * grunt-cli
3  * http://gruntjs.com/
4  *
5  * Copyright (c) 2016 Tyler Kellen, contributors
6  * Licensed under the MIT license.
7  * https://github.com/gruntjs/grunt-init/blob/master/LICENSE-MIT
8  */
9
10 'use strict';
11
12 // External lib.
13 var nopt = require('nopt');
14 var gruntOptions = require('grunt-known-options');
15
16 // Parse `gruntOptions` into a form that nopt can handle.
17 exports.aliases = {};
18 exports.known = {};
19
20 Object.keys(gruntOptions).forEach(function(key) {
21   var short = gruntOptions[key].short;
22   if (short) {
23     exports.aliases[short] = '--' + key;
24   }
25   exports.known[key] = gruntOptions[key].type;
26 });
27
28 // Parse them and return an options object.
29 Object.defineProperty(exports, 'options', {
30   get: function() {
31     return nopt(exports.known, exports.aliases, process.argv, 2);
32   }
33 });