@@ -7,7 +7,8 @@ import 'package:args/args.dart';
77enum RuntimeFlavor {
88 aot (help: 'Compile and run as a native binary.' ),
99 jit (
10- help: 'Run as-is without compilation, '
10+ help:
11+ 'Run as-is without compilation, '
1112 'using the just-in-time (JIT) runtime.' ,
1213 ),
1314 js (help: 'Compile to JavaScript and run on node.' ),
@@ -36,13 +37,17 @@ class BenchOptions {
3637 final result = _parserForBenchOptions.parse (args);
3738
3839 if (result.rest.isNotEmpty) {
39- throw FormatException ('All arguments must be provided via `--` options. '
40- 'Not sure what to do with "${result .rest .join ()}".' );
40+ throw FormatException (
41+ 'All arguments must be provided via `--` options. '
42+ 'Not sure what to do with "${result .rest .join ()}".' ,
43+ );
4144 }
4245
4346 return BenchOptions (
44- flavor:
45- result.multiOption ('flavor' ).map (RuntimeFlavor .values.byName).toSet (),
47+ flavor: result
48+ .multiOption ('flavor' )
49+ .map (RuntimeFlavor .values.byName)
50+ .toSet (),
4651 target: result.option ('target' )! ,
4752 help: result.flag ('help' ),
4853 verbose: result.flag ('verbose' ),
@@ -60,23 +65,31 @@ class BenchOptions {
6065 static String get usage => _parserForBenchOptions.usage;
6166
6267 static final _parserForBenchOptions = ArgParser ()
63- ..addMultiOption ('flavor' ,
64- abbr: 'f' ,
65- allowed: RuntimeFlavor .values.map ((e) => e.name),
66- allowedHelp: {
67- for (final flavor in RuntimeFlavor .values) flavor.name: flavor.help
68- })
69- ..addOption ('target' ,
70- defaultsTo: 'benchmark/benchmark.dart' ,
71- help: 'The target script to compile and run.' )
72- ..addFlag ('help' ,
73- defaultsTo: false ,
74- negatable: false ,
75- help: 'Print usage information and quit.' ,
76- abbr: 'h' )
77- ..addFlag ('verbose' ,
78- defaultsTo: false ,
79- negatable: false ,
80- help: 'Print the full stack trace if an exception is thrown.' ,
81- abbr: 'v' );
68+ ..addMultiOption (
69+ 'flavor' ,
70+ abbr: 'f' ,
71+ allowed: RuntimeFlavor .values.map ((e) => e.name),
72+ allowedHelp: {
73+ for (final flavor in RuntimeFlavor .values) flavor.name: flavor.help,
74+ },
75+ )
76+ ..addOption (
77+ 'target' ,
78+ defaultsTo: 'benchmark/benchmark.dart' ,
79+ help: 'The target script to compile and run.' ,
80+ )
81+ ..addFlag (
82+ 'help' ,
83+ defaultsTo: false ,
84+ negatable: false ,
85+ help: 'Print usage information and quit.' ,
86+ abbr: 'h' ,
87+ )
88+ ..addFlag (
89+ 'verbose' ,
90+ defaultsTo: false ,
91+ negatable: false ,
92+ help: 'Print the full stack trace if an exception is thrown.' ,
93+ abbr: 'v' ,
94+ );
8295}
0 commit comments