| OLD | NEW |
| 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 173 |
| 174 if (args.isEmpty) { | 174 if (args.isEmpty) { |
| 175 print('No arguments provided.'); | 175 print('No arguments provided.'); |
| 176 print(USAGE); | 176 print(USAGE); |
| 177 print(argParser.getUsage()); | 177 print(argParser.getUsage()); |
| 178 exit(1); | 178 exit(1); |
| 179 } | 179 } |
| 180 | 180 |
| 181 final entrypoints = <Path>[]; | 181 final entrypoints = <Path>[]; |
| 182 try { | 182 try { |
| 183 final option = argParser.parse(args); | 183 final option = argParser.parse(args, continueParsing: true); |
| 184 | 184 |
| 185 // This checks to see if the root of all entrypoints is the same. | 185 // This checks to see if the root of all entrypoints is the same. |
| 186 // If it is not, then we display a warning, as package imports might fail. | 186 // If it is not, then we display a warning, as package imports might fail. |
| 187 var entrypointRoot; | 187 var entrypointRoot; |
| 188 for(final arg in option.rest) { | 188 for(final arg in option.rest) { |
| 189 var entrypoint = new Path(arg); | 189 var entrypoint = new Path(arg); |
| 190 entrypoints.add(entrypoint); | 190 entrypoints.add(entrypoint); |
| 191 | 191 |
| 192 if (entrypointRoot == null) { | 192 if (entrypointRoot == null) { |
| 193 entrypointRoot = entrypoint.directoryPath; | 193 entrypointRoot = entrypoint.directoryPath; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 '${dartdoc.totalTypes} types, and ${dartdoc.totalMembers} ' | 251 '${dartdoc.totalTypes} types, and ${dartdoc.totalMembers} ' |
| 252 'members.'); | 252 'members.'); |
| 253 } | 253 } |
| 254 }); | 254 }); |
| 255 }, onError: (AsyncError asyncError) { | 255 }, onError: (AsyncError asyncError) { |
| 256 print('Generation failed: ${asyncError.error}'); | 256 print('Generation failed: ${asyncError.error}'); |
| 257 dartdoc.cleanup(); | 257 dartdoc.cleanup(); |
| 258 exit(1); | 258 exit(1); |
| 259 }); | 259 }); |
| 260 } | 260 } |
| OLD | NEW |