verb
Version:
Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.
39 lines (33 loc) • 632 B
JavaScript
'use strict';
/**
* Persist a value on the config store.
*
* ```sh
* $ --option one=abc
* #=> {one: 'abc'}
*
* $ --option one
* #=> {one: true}
* ```
*/
module.exports = function(app) {
var config = app.config;
var args;
var option = app.get('argv.option');
if (option) {
args = option.split('=');
if (args.length === 2) {
config.set(args[0], args[1]);
} else {
config.set(args[0], true);
}
}
var enable = app.get('argv.enable');
if (enable) {
config.set(enable, true);
}
var disable = app.get('argv.disable');
if (disable) {
config.set(disable, false);
}
};