| 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 /// 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. | 6 /// 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 | 7 /// is run, demonstrates what the generated usage text looks like. |
| 8 * is run, demonstrates what the generated usage text looks like. | |
| 9 */ | |
| 10 library example; | 8 library example; |
| 11 | 9 |
| 12 import 'dart:io'; | 10 import 'dart:io'; |
| 13 | 11 |
| 14 import 'package:args/args.dart'; | 12 import 'package:args/args.dart'; |
| 15 | 13 |
| 16 main() { | 14 main() { |
| 17 var parser = new ArgParser(); | 15 var parser = new ArgParser(); |
| 18 | 16 |
| 19 parser.addOption('mode', abbr: 'm', defaultsTo: 'debug', | 17 parser.addOption('mode', abbr: 'm', defaultsTo: 'debug', |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 For example if the normal command that will be executed | 108 For example if the normal command that will be executed |
| 111 is 'dart file.dart' and you specify special command | 109 is 'dart file.dart' and you specify special command |
| 112 'python -u valgrind.py @ suffix' the final command will be | 110 'python -u valgrind.py @ suffix' the final command will be |
| 113 'python -u valgrind.py dart file.dart suffix'"""); | 111 'python -u valgrind.py dart file.dart suffix'"""); |
| 114 | 112 |
| 115 parser.addFlag('time', | 113 parser.addFlag('time', |
| 116 help: 'Print timing information after running tests', | 114 help: 'Print timing information after running tests', |
| 117 defaultsTo: false); | 115 defaultsTo: false); |
| 118 | 116 |
| 119 parser.addOption('dart', help: 'Path to dart executable'); | 117 parser.addOption('dart', help: 'Path to dart executable'); |
| 120 // TODO(antonm): rename the option. | |
| 121 parser.addOption('drt', help: 'Path to content shell executable'); | 118 parser.addOption('drt', help: 'Path to content shell executable'); |
| 122 parser.addOption('dartium', help: 'Path to Dartium Chrome executable'); | 119 parser.addOption('dartium', help: 'Path to Dartium Chrome executable'); |
| 123 | 120 |
| 124 parser.addFlag('batch', abbr: 'b', | 121 parser.addFlag('batch', abbr: 'b', |
| 125 help: 'Run browser tests in batch mode', | 122 help: 'Run browser tests in batch mode', |
| 126 defaultsTo: true); | 123 defaultsTo: true); |
| 127 | 124 |
| 128 print(parser.getUsage()); | 125 print(parser.getUsage()); |
| 129 } | 126 } |
| OLD | NEW |