Version 1
[yaffs-website] / node_modules / grunt / node_modules / grunt-cli / lib / cli.js
diff --git a/node_modules/grunt/node_modules/grunt-cli/lib/cli.js b/node_modules/grunt/node_modules/grunt-cli/lib/cli.js
new file mode 100644 (file)
index 0000000..0946006
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * grunt-cli
+ * http://gruntjs.com/
+ *
+ * Copyright (c) 2016 Tyler Kellen, contributors
+ * Licensed under the MIT license.
+ * https://github.com/gruntjs/grunt-init/blob/master/LICENSE-MIT
+ */
+
+'use strict';
+
+// External lib.
+var nopt = require('nopt');
+var gruntOptions = require('grunt-known-options');
+
+// Parse `gruntOptions` into a form that nopt can handle.
+exports.aliases = {};
+exports.known = {};
+
+Object.keys(gruntOptions).forEach(function(key) {
+  var short = gruntOptions[key].short;
+  if (short) {
+    exports.aliases[short] = '--' + key;
+  }
+  exports.known[key] = gruntOptions[key].type;
+});
+
+// Parse them and return an options object.
+Object.defineProperty(exports, 'options', {
+  get: function() {
+    return nopt(exports.known, exports.aliases, process.argv, 2);
+  }
+});