diff --git a/main.js b/main.js index 9d981b42..a0173862 100644 --- a/main.js +++ b/main.js @@ -53,7 +53,7 @@ env = { start: new Date(), finish: null }, - args: arguments.slice(1), // jsdoc.jar sets argument[0] to the abspath to main.js, user args follow + args: Array.prototype.slice.call(arguments, 1), // jsdoc.jar adds argument[0], the abspath to main.js, user args follow conf: {}, opts: {} }; @@ -113,15 +113,17 @@ function main() { } }; + env.opts = jsdoc.opts.parser.parse(env.args); + try { - env.conf = JSON.parse( require('common/fs').read(BASEDIR+'conf.json') ); + env.conf = JSON.parse( + require('common/fs').read( env.opts.configure || BASEDIR+'conf.json' ) + ); } catch (e) { throw('Configuration file cannot be evaluated. '+e); } - env.opts = jsdoc.opts.parser.parse(env.args); - if (env.opts.query) { env.opts.query = require('common/query').toObject(env.opts.query); } diff --git a/modules/jsdoc/opts/parser.js b/modules/jsdoc/opts/parser.js index f0945f74..3daffadd 100644 --- a/modules/jsdoc/opts/parser.js +++ b/modules/jsdoc/opts/parser.js @@ -17,6 +17,7 @@ }; argsParser.addOption('t', 'template', true, 'The name of the template to use. Default: the "default" template'); + argsParser.addOption('c', 'configure', true, 'The path to the configuration file. Default: jsdoc basedir + conf.json'); argsParser.addOption('e', 'encoding', true, 'Assume this encoding when reading all source files. Default: your system default encoding'); argsParser.addOption('n', 'nocode', false, 'Ignore doclets that don\'t explicitly provide a symbol name.'); argsParser.addOption('T', 'test', false, 'Run all tests and quit.');