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 * This is an example of converting the args in test.dart to use this API. | 6 * This is an example of converting the args in test.dart to use this API. |
7 * It shows what it looks like to build an [ArgParser] and then, when the code | 7 * It shows what it looks like to build an [ArgParser] and then, when the code |
8 * is run, demonstrates what the generated usage text looks like. | 8 * is run, demonstrates what the generated usage text looks like. |
9 */ | 9 */ |
10 #library('example'); | 10 #library('example'); |
(...skipping 10 matching lines...) Expand all Loading... |
21 allowed: ['all', 'debug', 'release']); | 21 allowed: ['all', 'debug', 'release']); |
22 | 22 |
23 parser.addOption('compiler', abbr: 'c', defaultsTo: 'none', | 23 parser.addOption('compiler', abbr: 'c', defaultsTo: 'none', |
24 help: 'Specify any compilation step (if needed).', | 24 help: 'Specify any compilation step (if needed).', |
25 allowed: ['none', 'dart2js', 'dartc'], | 25 allowed: ['none', 'dart2js', 'dartc'], |
26 allowedHelp: { | 26 allowedHelp: { |
27 'none': 'Do not compile the Dart code (run native Dart code on the' | 27 'none': 'Do not compile the Dart code (run native Dart code on the' |
28 ' VM).\n(only valid with the following runtimes: vm, drt)', | 28 ' VM).\n(only valid with the following runtimes: vm, drt)', |
29 'dart2js': 'Compile dart code to JavaScript by running dart2js.\n' | 29 'dart2js': 'Compile dart code to JavaScript by running dart2js.\n' |
30 '(only valid with the following runtimes: d8, drt, chrome\n' | 30 '(only valid with the following runtimes: d8, drt, chrome\n' |
31 'safari, ie, firefox, opera, none (compile only))' | 31 'safari, ie, firefox, opera, none (compile only))', |
32 'dartc': 'Perform static analysis on Dart code by running dartc.\n' | 32 'dartc': 'Perform static analysis on Dart code by running dartc.\n' |
33 '(only valid with the following runtimes: none)', | 33 '(only valid with the following runtimes: none)', |
34 }); | 34 }); |
35 | 35 |
36 parser.addOption('runtime', abbr: 'r', defaultsTo: 'vm', | 36 parser.addOption('runtime', abbr: 'r', defaultsTo: 'vm', |
37 help: 'Where the tests should be run.', | 37 help: 'Where the tests should be run.', |
38 allowed: ['vm', 'd8', 'drt', 'dartium', 'ff', 'firefox', 'chrome', | 38 allowed: ['vm', 'd8', 'drt', 'dartium', 'ff', 'firefox', 'chrome', |
39 'safari', 'ie', 'opera', 'none'], | 39 'safari', 'ie', 'opera', 'none'], |
40 allowedHelp: { | 40 allowedHelp: { |
41 'vm': 'Run Dart code on the standalone dart vm.', | 41 'vm': 'Run Dart code on the standalone dart vm.', |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 parser.addOption('dart', help: 'Path to dart executable'); | 118 parser.addOption('dart', help: 'Path to dart executable'); |
119 parser.addOption('drt', help: 'Path to DumpRenderTree executable'); | 119 parser.addOption('drt', help: 'Path to DumpRenderTree executable'); |
120 parser.addOption('dartium', help: 'Path to Dartium Chrome executable'); | 120 parser.addOption('dartium', help: 'Path to Dartium Chrome executable'); |
121 | 121 |
122 parser.addFlag('batch', abbr: 'b', | 122 parser.addFlag('batch', abbr: 'b', |
123 help: 'Run browser tests in batch mode', | 123 help: 'Run browser tests in batch mode', |
124 defaultsTo: true); | 124 defaultsTo: true); |
125 | 125 |
126 print(parser.getUsage()); | 126 print(parser.getUsage()); |
127 } | 127 } |
OLD | NEW |