From b96fc0f6e6f0af8899b2b7956d734ef18253e1d5 Mon Sep 17 00:00:00 2001 From: Michael Mathews Date: Fri, 7 Jan 2011 12:26:21 +0000 Subject: [PATCH] Added option -D to dump the doclets to console and quit, possibly useful for debugging? --- main.js | 8 +++++--- modules/jsdoc/opts/parser.js | 10 ++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/main.js b/main.js index d1d7beb0..8c746df0 100644 --- a/main.js +++ b/main.js @@ -154,9 +154,11 @@ function main() { require('jsdoc/src/handlers'); docs = app.jsdoc.parser.parse(sourceFiles, env.opts.encoding); -//print('dumping docs...'); -//dump(docs); -//exit(0); + + if (env.opts.dump) { + dump(docs); + exit(0); + } env.opts.template = env.opts.template || 'default'; diff --git a/modules/jsdoc/opts/parser.js b/modules/jsdoc/opts/parser.js index cdaf121f..48629d98 100644 --- a/modules/jsdoc/opts/parser.js +++ b/modules/jsdoc/opts/parser.js @@ -19,14 +19,16 @@ argsParser.addOption('t', 'template', true, 'The name of the template to use. Default: the "default" template'); 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 unit tests and quit.'); - argsParser.addOption('d', 'destination', true, 'The path to the output folder. Use "stdout.json" or "stdout.xml" to dump data to the console. Default: ./jsdocs'); + argsParser.addOption('T', 'test', false, 'Run all tests and quit.'); + argsParser.addOption('d', 'destination', true, 'The path to the output folder. Use "console" to dump data to the console. Default: console'); argsParser.addOption('V', 'validate', false, 'Validate the results produced by parsing the source code.'); argsParser.addOption('r', 'recurse', false, 'Recurse into subdirectories when scanning for source code files.'); argsParser.addOption('h', 'help', false, 'Print this message and quit.'); - + argsParser.addOption('D', 'dump', false, 'Dump all found doclet internals to console and quit.'); + + // TODO [-R, recurseonly] = a number representing the depth to recurse -// TODO [-f, filter] = a regex to filter on +// TODO [-f, filter] = a regex to filter on <-- this can be better defined in the configs? /** Set the options for this app.