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

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: Done 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/args/test/parse_all_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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 200
201 if (args.isEmpty) { 201 if (args.isEmpty) {
202 print('No arguments provided.'); 202 print('No arguments provided.');
203 print(USAGE); 203 print(USAGE);
204 print(argParser.getUsage()); 204 print(argParser.getUsage());
205 exit(1); 205 exit(1);
206 } 206 }
207 207
208 final entrypoints = <Uri>[]; 208 final entrypoints = <Uri>[];
209 try { 209 try {
210 final option = argParser.parse(args); 210 final option = argParser.parse(args, allowTrailingOptions: true);
211 211
212 // This checks to see if the root of all entrypoints is the same. 212 // This checks to see if the root of all entrypoints is the same.
213 // If it is not, then we display a warning, as package imports might fail. 213 // If it is not, then we display a warning, as package imports might fail.
214 var entrypointRoot; 214 var entrypointRoot;
215 for (final entrypoint in option.rest) { 215 for (final entrypoint in option.rest) {
216 var uri = Uri.parse(entrypoint); 216 var uri = Uri.parse(entrypoint);
217 if (uri.scheme == '') uri = path.toUri(entrypoint); 217 if (uri.scheme == '') uri = path.toUri(entrypoint);
218 entrypoints.add(uri); 218 entrypoints.add(uri);
219 219
220 if (uri.scheme != 'file') continue; 220 if (uri.scheme != 'file') continue;
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 // If there is not, then check if the entrypoint is somewhere in a `lib` 281 // If there is not, then check if the entrypoint is somewhere in a `lib`
282 // directory. 282 // directory.
283 var parts = path.split(path.dirname(script)); 283 var parts = path.split(path.dirname(script));
284 var libDir = parts.lastIndexOf('lib'); 284 var libDir = parts.lastIndexOf('lib');
285 if (libDir > 0) { 285 if (libDir > 0) {
286 return path.join(path.joinAll(parts.take(libDir)), 'packages'); 286 return path.join(path.joinAll(parts.take(libDir)), 'packages');
287 } else { 287 } else {
288 return null; 288 return null;
289 } 289 }
290 } 290 }
OLDNEW
« no previous file with comments | « pkg/args/test/parse_all_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698