diff --git a/main.js b/main.js index 70032bf5..48b7f0ca 100644 --- a/main.js +++ b/main.js @@ -65,7 +65,7 @@ } if (opts._.length > 0) { - sourceFiles = jsdoc.src.getFilePaths(opts._); + sourceFiles = jsdoc.src.getFilePaths(opts._, (opts.recurse? 10 : undefined)); jsdoc.parser.parseFiles(sourceFiles, opts.encoding); diff --git a/modules/jsdoc/opts.js b/modules/jsdoc/opts.js index bc0cfc68..eb636404 100644 --- a/modules/jsdoc/opts.js +++ b/modules/jsdoc/opts.js @@ -27,7 +27,8 @@ 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('h', 'help', false, 'Print help message and quit.'); argsParser.addOption('V', 'validate', false, 'Validate the results produced by parsing the source code.'); - + argsParser.addOption('r', 'recurse', false, 'Recurse into subdirectories to find source files.'); + /** Set the options for this app. @method set diff --git a/test/tests/01_jsdoc_opts.js b/test/tests/01_jsdoc_opts.js index 7fac0add..678d9a06 100644 --- a/test/tests/01_jsdoc_opts.js +++ b/test/tests/01_jsdoc_opts.js @@ -57,6 +57,14 @@ }); }); + //// setting the recurse option + describe('The return value of jsdoc.opts#recurse when called with `-r`', function() { + it('should have a property `recurse` set to true', function() { + var returnedValue = jsdoc.opts.set(['-r', true]); + expect(returnedValue.recurse).to(be, true); + }); + }); + describe('The return value of jsdoc.opts#set when called with `["--destination", "flib/flub.json"]`', function() { it('should have a property `destination` set to "flib/flub.json"', function() { var returnedValue = jsdoc.opts.set(['--destination', 'flib/flub.json']);