From 03d9a9f16debe216cd911ca9429492f88df80b2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Wrzeszcz?= Date: Sat, 10 Dec 2011 23:02:47 +0100 Subject: [PATCH] Allow to define runtime options in configuration file. --- jsdoc.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/jsdoc.js b/jsdoc.js index 4353576b..beaf2b22 100644 --- a/jsdoc.js +++ b/jsdoc.js @@ -159,6 +159,16 @@ function main() { env.opts.query = require('query').toObject(env.opts.query); } + // allow to pass arguments from configuration file + if (env.conf.opts) { + for (var opt in env.conf.opts) { + // arguments passed in command are more important + if (!(opt in env.opts)) { + env.opts[opt] = env.conf.opts[opt]; + } + } + } + // which version of javascript will be supported? (rhino only) if (typeof version === 'function') { version(env.conf.jsVersion || 180); @@ -244,4 +254,4 @@ function main() { else { // TODO throw no publish warning? } } -} \ No newline at end of file +}