| OLD | NEW |
| 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'; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 docgen(results.rest.map(path.normalize).toList(), | 25 docgen(results.rest.map(path.normalize).toList(), |
| 26 packageRoot: results['package-root'], | 26 packageRoot: results['package-root'], |
| 27 outputToYaml: !results['json'], | 27 outputToYaml: !results['json'], |
| 28 includePrivate: results['include-private'], | 28 includePrivate: results['include-private'], |
| 29 includeSdk: includeSdk, | 29 includeSdk: includeSdk, |
| 30 parseSdk: results['parse-sdk'], | 30 parseSdk: results['parse-sdk'], |
| 31 append: results['append'] && new Directory(results['out']).existsSync(), | 31 append: results['append'] && new Directory(results['out']).existsSync(), |
| 32 introFileName: introduction, | 32 introFileName: introduction, |
| 33 out: results['out'], | 33 out: results['out'], |
| 34 excludeLibraries: excludedLibraries, | 34 excludeLibraries: excludedLibraries, |
| 35 includeDependentPackages: results['include-dependent-packages']); | 35 includeDependentPackages: results['include-dependent-packages'], |
| 36 startPage: results['startPage']); |
| 36 } | 37 } |
| 37 | 38 |
| 38 /** | 39 /** |
| 39 * Creates parser for docgen command line arguments. | 40 * Creates parser for docgen command line arguments. |
| 40 */ | 41 */ |
| 41 ArgParser _initArgParser() { | 42 ArgParser _initArgParser() { |
| 42 var parser = new ArgParser(); | 43 var parser = new ArgParser(); |
| 43 parser.addFlag('help', abbr: 'h', | 44 parser.addFlag('help', abbr: 'h', |
| 44 help: 'Prints help and usage information.', | 45 help: 'Prints help and usage information.', |
| 45 negatable: false, | 46 negatable: false, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 defaultsTo: 'docs'); | 81 defaultsTo: 'docs'); |
| 81 parser.addOption('exclude-lib', | 82 parser.addOption('exclude-lib', |
| 82 help: 'Exclude the library by this name from the documentation', | 83 help: 'Exclude the library by this name from the documentation', |
| 83 allowMultiple: true, | 84 allowMultiple: true, |
| 84 callback: (libs) => excludedLibraries.addAll(libs)); | 85 callback: (libs) => excludedLibraries.addAll(libs)); |
| 85 parser.addFlag('include-dependent-packages', | 86 parser.addFlag('include-dependent-packages', |
| 86 help: 'Assumes we are documenting a single package and are running ' | 87 help: 'Assumes we are documenting a single package and are running ' |
| 87 'in the directory with its pubspec. Includes documentation for all ' | 88 'in the directory with its pubspec. Includes documentation for all ' |
| 88 'of its dependent packages.', | 89 'of its dependent packages.', |
| 89 defaultsTo: false, negatable: false); | 90 defaultsTo: false, negatable: false); |
| 91 parser.addOption('startPage', |
| 92 help: 'By default the viewer will start at the SDK introduction page.' |
| 93 'To start at some other page, e.g. for a package, provide the name ' |
| 94 'of the package in this argument, e.g. --startPage=intl will make ' |
| 95 'the start page of the viewer be the intl package.', |
| 96 defaultsTo: null); |
| 97 |
| 90 return parser; | 98 return parser; |
| 91 } | 99 } |
| OLD | NEW |