base-cli-process
Version:
Normalizers for common argv commands handled by the base-cli plugin. Also pre-processes the given object with base-cli-schema before calling `.process()`
27 lines (23 loc) • 395 B
JavaScript
;
var debug = require('../debug');
/**
* Enable or disable Table of Contents rendering
*
* ```sh
* # enable
* $ app --toc
* # or
* $ app --toc=true
* # disable
* $ app --toc=false
* ```
* @name toc
* @api public
*/
module.exports = function(app) {
return function(val, key, config, next) {
debug.field(key, val);
app.option('toc', val);
next();
};
};