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

Side by Side Diff: sdk/lib/_internal/dartdoc/bin/dartdoc.dart

Issue 12545013: Added the continueParsing option to ArgParser. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Style + commentary. Created 7 years, 8 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
« pkg/args/test/parse_test.dart ('K') | « pkg/args/test/parse_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 /** 5 /**
6 * To generate docs for a library, run this script with the path to an 6 * To generate docs for a library, run this script with the path to an
7 * entrypoint .dart file, like: 7 * entrypoint .dart file, like:
8 * 8 *
9 * $ dart dartdoc.dart foo.dart 9 * $ dart dartdoc.dart foo.dart
10 * 10 *
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 193
194 if (args.isEmpty) { 194 if (args.isEmpty) {
195 print('No arguments provided.'); 195 print('No arguments provided.');
196 print(USAGE); 196 print(USAGE);
197 print(argParser.getUsage()); 197 print(argParser.getUsage());
198 exit(1); 198 exit(1);
199 } 199 }
200 200
201 final entrypoints = <Uri>[]; 201 final entrypoints = <Uri>[];
202 try { 202 try {
203 final option = argParser.parse(args); 203 final option = argParser.parse(args, continueParsing: true);
204 204
205 // This checks to see if the root of all entrypoints is the same. 205 // This checks to see if the root of all entrypoints is the same.
206 // If it is not, then we display a warning, as package imports might fail. 206 // If it is not, then we display a warning, as package imports might fail.
207 var entrypointRoot; 207 var entrypointRoot;
208 for (final entrypoint in option.rest) { 208 for (final entrypoint in option.rest) {
209 var uri = Uri.parse(entrypoint); 209 var uri = Uri.parse(entrypoint);
210 if (uri.scheme == '') uri = pathToFileUri(entrypoint); 210 if (uri.scheme == '') uri = pathToFileUri(entrypoint);
211 entrypoints.add(uri); 211 entrypoints.add(uri);
212 212
213 if (uri.scheme != 'file') continue; 213 if (uri.scheme != 'file') continue;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 // If there is not, then check if the entrypoint is somewhere in a `lib` 273 // If there is not, then check if the entrypoint is somewhere in a `lib`
274 // directory. 274 // directory.
275 var parts = path.split(path.dirname(script)); 275 var parts = path.split(path.dirname(script));
276 var libDir = parts.lastIndexOf('lib'); 276 var libDir = parts.lastIndexOf('lib');
277 if (libDir > 0) { 277 if (libDir > 0) {
278 return path.join(path.joinAll(parts.take(libDir)), 'packages'); 278 return path.join(path.joinAll(parts.take(libDir)), 'packages');
279 } else { 279 } else {
280 return null; 280 return null;
281 } 281 }
282 } 282 }
OLDNEW
« pkg/args/test/parse_test.dart ('K') | « pkg/args/test/parse_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698