Chromium Code Reviews| Index: pkg/docgen/bin/docgen.dart |
| diff --git a/pkg/docgen/bin/docgen.dart b/pkg/docgen/bin/docgen.dart |
| index cb045378ef144b675a28fd6604519e6fee4aa8f7..74644bc9cb55929f988d57a210cfa512bbfaacd8 100644 |
| --- a/pkg/docgen/bin/docgen.dart |
| +++ b/pkg/docgen/bin/docgen.dart |
| @@ -10,6 +10,8 @@ import 'package:logging/logging.dart'; |
| import '../lib/docgen.dart'; |
| import 'package:path/path.dart' as path; |
| +List<String> excludedLibraries = []; |
| + |
| /** |
| * Analyzes Dart files and generates a representation of included libraries, |
| * classes, and members. |
| @@ -18,15 +20,19 @@ void main(List<String> arguments) { |
| logger.onRecord.listen((record) => print(record.message)); |
| var results = _initArgParser().parse(arguments); |
| + var intro = path.join(path.dirname(Platform.script.toFilePath()), |
| + 'sdk-introduction.md'); |
| docgen(results.rest.map(path.normalize).toList(), |
| packageRoot: results['package-root'], |
| outputToYaml: !results['json'], |
| includePrivate: results['include-private'], |
| includeSdk: results['parse-sdk'] || results['include-sdk'], |
| parseSdk: results['parse-sdk'], |
| - append: results['append'] && new Directory('docs').existsSync(), |
| + append: results['append'] && new Directory(results['out']).existsSync(), |
| introduction: (results['parse-sdk'] || results['include-sdk']) ? |
| - 'sdk-introduction.md' : results['introduction']); |
| + intro : results['introduction'], |
|
Bob Nystrom
2013/11/14 22:43:04
Multi-line ternary operator in the middle of an ex
Alan Knight
2013/11/15 18:49:56
Done.
|
| + out: results['out'], |
| + excludeLibraries: excludedLibraries); |
| } |
| /** |
| @@ -69,6 +75,12 @@ ArgParser _initArgParser() { |
| parser.addOption('introduction', |
| help: 'Adds the provided markdown text file as the introduction' |
| ' for the outputted documentation.', defaultsTo: ''); |
| - |
| + parser.addOption('out', |
| + help: 'The name of the output directory.', |
| + defaultsTo: 'docs'); |
| + parser.addOption('exclude-lib', |
| + help: 'Exclude the library by this name from the documentation', |
| + allowMultiple: true, |
| + callback: (libs) => excludedLibraries.addAll(libs)); |
| return parser; |
| } |