Added support for the -r (recurse) option to the options processor.

This commit is contained in:
Michael Mathews 2010-12-18 12:44:14 +00:00
parent 3f0b393b0e
commit 71144fa6ce
3 changed files with 11 additions and 2 deletions

View File

@ -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);

View File

@ -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

View File

@ -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']);