| 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 import 'package:path/path.dart' as path; | 9 import 'package:path/path.dart' as path; |
| 10 | 10 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 return true; | 76 return true; |
| 77 } | 77 } |
| 78 | 78 |
| 79 /** | 79 /** |
| 80 * If we've specified just a package and no other command-line options, | 80 * If we've specified just a package and no other command-line options, |
| 81 * use the single package name as the start page. | 81 * use the single package name as the start page. |
| 82 */ | 82 */ |
| 83 String _defaultStartPageFor(files) { | 83 String _defaultStartPageFor(files) { |
| 84 var pubspec = new File(path.join(files.first, 'pubspec.yaml')); | 84 var pubspec = new File(path.join(files.first, 'pubspec.yaml')); |
| 85 if (!pubspec.existsSync()) return null; | 85 if (!pubspec.existsSync()) return null; |
| 86 return Library.packageNameFor(files.first); | 86 return packageNameFor(files.first); |
| 87 } | 87 } |
| 88 | 88 |
| 89 /** | 89 /** |
| 90 * Creates parser for docgen command line arguments. | 90 * Creates parser for docgen command line arguments. |
| 91 */ | 91 */ |
| 92 ArgParser _initArgParser() { | 92 ArgParser _initArgParser() { |
| 93 var parser = new ArgParser(); | 93 var parser = new ArgParser(); |
| 94 parser.addFlag('help', abbr: 'h', | 94 parser.addFlag('help', abbr: 'h', |
| 95 help: 'Prints help and usage information.', | 95 help: 'Prints help and usage information.', |
| 96 negatable: false, | 96 negatable: false, |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 defaultsTo: null); | 149 defaultsTo: null); |
| 150 parser.addOption('start-page', | 150 parser.addOption('start-page', |
| 151 help: 'By default the viewer will start at the SDK introduction page. ' | 151 help: 'By default the viewer will start at the SDK introduction page. ' |
| 152 'To start at some other page, e.g. for a package, provide the name ' | 152 'To start at some other page, e.g. for a package, provide the name ' |
| 153 'of the package in this argument, e.g. --start-page=intl will make ' | 153 'of the package in this argument, e.g. --start-page=intl will make ' |
| 154 'the start page of the viewer be the intl package.', | 154 'the start page of the viewer be the intl package.', |
| 155 defaultsTo: null); | 155 defaultsTo: null); |
| 156 | 156 |
| 157 return parser; | 157 return parser; |
| 158 } | 158 } |
| OLD | NEW |