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

Side by Side Diff: pkg/docgen/bin/docgen.dart

Issue 21184003: Added a flag --append to docgen. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/docgen/lib/docgen.dart » ('j') | pkg/docgen/lib/docgen.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:io'; 5 import 'dart:io';
6 6
7 import 'package:args/args.dart'; 7 import 'package:args/args.dart';
8 import 'package:logging/logging.dart'; 8 import 'package:logging/logging.dart';
9 9
10 import '../lib/docgen.dart'; 10 import '../lib/docgen.dart';
11 11
12 /** 12 /**
13 * Analyzes Dart files and generates a representation of included libraries, 13 * Analyzes Dart files and generates a representation of included libraries,
14 * classes, and members. 14 * classes, and members.
15 */ 15 */
16 void main() { 16 void main() {
17 logger.onRecord.listen((record) => print(record.message)); 17 logger.onRecord.listen((record) => print(record.message));
18 var results = _initArgParser().parse(new Options().arguments); 18 var results = _initArgParser().parse(new Options().arguments);
19 19
20 docgen(results.rest, 20 docgen(results.rest,
21 packageRoot: results['package-root'], 21 packageRoot: results['package-root'],
22 outputToYaml: !results['json'], 22 outputToYaml: !results['json'],
23 includePrivate: results['include-private'], 23 includePrivate: results['include-private'],
24 includeSdk: results['parse-sdk'] || results['include-sdk'], 24 includeSdk: results['parse-sdk'] || results['include-sdk'],
25 parseSdk: results['parse-sdk']); 25 parseSdk: results['parse-sdk'],
26 append: results['append'] && new Directory('docs').existsSync());
26 } 27 }
27 28
28 /** 29 /**
29 * Creates parser for docgen command line arguments. 30 * Creates parser for docgen command line arguments.
30 */ 31 */
31 ArgParser _initArgParser() { 32 ArgParser _initArgParser() {
32 var parser = new ArgParser(); 33 var parser = new ArgParser();
33 parser.addFlag('help', abbr: 'h', 34 parser.addFlag('help', abbr: 'h',
34 help: 'Prints help and usage information.', 35 help: 'Prints help and usage information.',
35 negatable: false, 36 negatable: false,
(...skipping 14 matching lines...) Expand all
50 negatable: true); 51 negatable: true);
51 parser.addFlag('include-private', 52 parser.addFlag('include-private',
52 help: 'Flag to include private declarations.', negatable: false); 53 help: 'Flag to include private declarations.', negatable: false);
53 parser.addFlag('include-sdk', 54 parser.addFlag('include-sdk',
54 help: 'Flag to parse SDK Library files.', negatable: false); 55 help: 'Flag to parse SDK Library files.', negatable: false);
55 parser.addFlag('parse-sdk', 56 parser.addFlag('parse-sdk',
56 help: 'Parses the SDK libraries only.', 57 help: 'Parses the SDK libraries only.',
57 defaultsTo: false, negatable: false); 58 defaultsTo: false, negatable: false);
58 parser.addOption('package-root', 59 parser.addOption('package-root',
59 help: "Sets the package root of the library being analyzed."); 60 help: "Sets the package root of the library being analyzed.");
61 parser.addFlag('append',
62 help: 'Append to the docs folder, library_list.txt and index.txt',
63 defaultsTo: false, negatable: false);
60 64
61 return parser; 65 return parser;
62 } 66 }
OLDNEW
« no previous file with comments | « no previous file | pkg/docgen/lib/docgen.dart » ('j') | pkg/docgen/lib/docgen.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698