Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Unified Diff: pkg/docgen/bin/docgen.dart

Issue 18438003: Removed ArgResult in lib/docgen.dart and removed top level variables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/docgen/lib/docgen.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/docgen/bin/docgen.dart
diff --git a/pkg/docgen/bin/docgen.dart b/pkg/docgen/bin/docgen.dart
index df6ce632d55f20297103d3a7db5b599122fe06e3..d10c325f0ce0127d3670842a6c330755dce4628f 100644
--- a/pkg/docgen/bin/docgen.dart
+++ b/pkg/docgen/bin/docgen.dart
@@ -15,15 +15,20 @@ import '../lib/docgen.dart';
*/
void main() {
logger.onRecord.listen((record) => print(record.message));
- var results = initArgParser().parse(new Options().arguments);
- if (results['help']) return;
- docgen(results);
+ var results = _initArgParser().parse(new Options().arguments);
+
+ docgen(results.rest,
+ packageRoot: results['package-root'],
+ outputToYaml: !results['json'],
+ includePrivate: results['include-private'],
+ includeSdk: results['parse-sdk'] || results['include-sdk'],
+ parseSdk: results['parse-sdk']);
}
/**
* Creates parser for docgen command line arguments.
*/
-ArgParser initArgParser() {
+ArgParser _initArgParser() {
var parser = new ArgParser();
parser.addFlag('help', abbr: 'h',
help: 'Prints help and usage information.',
@@ -32,6 +37,7 @@ ArgParser initArgParser() {
if (help) {
logger.info(parser.getUsage());
logger.info(USAGE);
+ exit(0);
}
});
parser.addFlag('verbose', abbr: 'v',
@@ -39,15 +45,9 @@ ArgParser initArgParser() {
callback: (verbose) {
if (verbose) Logger.root.level = Level.FINEST;
});
- parser.addOption('output-format', abbr: 'o',
- help: 'Sets the output format.',
- allowed: ['yaml', 'json'],
- allowedHelp: {'yaml' : 'Outputs to YAML. (Default)',
- 'json' : 'Outputs to JSON.'});
- parser.addFlag('yaml', abbr: 'y',
- help: 'Same as output-format=yaml.', negatable: false);
parser.addFlag('json', abbr: 'j',
- help: 'Same as output-format=json.', negatable: false);
+ help: 'Outputs to JSON. Files are outputted to YAML by default.',
+ negatable: true);
parser.addFlag('include-private',
help: 'Flag to include private declarations.', negatable: false);
parser.addFlag('include-sdk',
« no previous file with comments | « no previous file | pkg/docgen/lib/docgen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698