Chromium Code Reviews| 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 #library('dart2js'); | 5 #library('dart2js'); |
| 6 | 6 |
| 7 #import('dart:io'); | 7 #import('dart:io'); |
| 8 #import('dart:uri'); | 8 #import('dart:uri'); |
| 9 #import('dart:utf'); | 9 #import('dart:utf'); |
| 10 | 10 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 List<String> options = new List<String>(); | 59 List<String> options = new List<String>(); |
| 60 bool explicitOut = false; | 60 bool explicitOut = false; |
| 61 bool wantHelp = false; | 61 bool wantHelp = false; |
| 62 | 62 |
| 63 passThrough(String argument) => options.add(argument); | 63 passThrough(String argument) => options.add(argument); |
| 64 | 64 |
| 65 List<String> arguments = <String>[]; | 65 List<String> arguments = <String>[]; |
| 66 List<OptionHandler> handlers = <OptionHandler>[ | 66 List<OptionHandler> handlers = <OptionHandler>[ |
| 67 new OptionHandler('--throw-on-error', (_) => throwOnError = true), | 67 new OptionHandler('--throw-on-error', (_) => throwOnError = true), |
| 68 new OptionHandler('--suppress-warnings', (_) => showWarnings = false), | 68 new OptionHandler('--suppress-warnings', (_) => showWarnings = false), |
| 69 new OptionHandler('--2dart', passThrough), | |
|
ahe
2012/05/21 15:38:55
I'm not too fond of the name of this option. How a
| |
| 69 new OptionHandler('--verbose|-v', (_) => verbose = true), | 70 new OptionHandler('--verbose|-v', (_) => verbose = true), |
| 70 new OptionHandler('--library-root=.+', (String argument) { | 71 new OptionHandler('--library-root=.+', (String argument) { |
| 71 String path = nativeToUriPath(extractParameter(argument)); | 72 String path = nativeToUriPath(extractParameter(argument)); |
| 72 if (!path.endsWith("/")) path = "$path/"; | 73 if (!path.endsWith("/")) path = "$path/"; |
| 73 libraryRoot = cwd.resolve(path); | 74 libraryRoot = cwd.resolve(path); |
| 74 }), | 75 }), |
| 75 new OptionHandler('--out=.+|-o.+', (String argument) { | 76 new OptionHandler('--out=.+|-o.+', (String argument) { |
| 76 explicitOut = true; | 77 explicitOut = true; |
| 77 out = cwd.resolve(nativeToUriPath(extractParameter(argument))); | 78 out = cwd.resolve(nativeToUriPath(extractParameter(argument))); |
| 78 }), | 79 }), |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 236 Display this message (add -v for information about all options). | 237 Display this message (add -v for information about all options). |
| 237 | 238 |
| 238 -v, --verbose | 239 -v, --verbose |
| 239 Display verbose information. | 240 Display verbose information. |
| 240 | 241 |
| 241 --suppress-warnings | 242 --suppress-warnings |
| 242 Do not display any warnings. | 243 Do not display any warnings. |
| 243 | 244 |
| 244 --no-colors | 245 --no-colors |
| 245 Do not add colors to diagnostic messages. | 246 Do not add colors to diagnostic messages. |
| 246 | 247 |
|
ahe
2012/05/21 15:38:55
Please document the option here.
| |
| 247 The following options are only used for compiler development and may | 248 The following options are only used for compiler development and may |
| 248 be removed in a future version: | 249 be removed in a future version: |
| 249 --throw-on-error | 250 --throw-on-error |
| 250 Throw an exception if a compile-time error is detected. | 251 Throw an exception if a compile-time error is detected. |
| 251 | 252 |
| 252 --library-root=<directory> | 253 --library-root=<directory> |
| 253 Where to find the Dart platform libraries. | 254 Where to find the Dart platform libraries. |
| 254 | 255 |
| 255 --allow-mock-compilation | 256 --allow-mock-compilation |
| 256 Do not generate a call to main if either of the following | 257 Do not generate a call to main if either of the following |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 281 } catch (var ignored) { | 282 } catch (var ignored) { |
| 282 print('Internal error: error while printing exception'); | 283 print('Internal error: error while printing exception'); |
| 283 } | 284 } |
| 284 try { | 285 try { |
| 285 print(trace); | 286 print(trace); |
| 286 } finally { | 287 } finally { |
| 287 exit(253); // 253 is recognized as a crash by our test scripts. | 288 exit(253); // 253 is recognized as a crash by our test scripts. |
| 288 } | 289 } |
| 289 } | 290 } |
| 290 } | 291 } |
| OLD | NEW |