Chromium Code Reviews| Index: lib/src/options.dart |
| diff --git a/lib/src/options.dart b/lib/src/options.dart |
| index cf4664eb6ca0594607dc07c5c19469ba956c7d5d..b5a976ea409c634f68789e13e9c0485d1edb6be4 100644 |
| --- a/lib/src/options.dart |
| +++ b/lib/src/options.dart |
| @@ -31,6 +31,12 @@ class CompilerOptions { |
| /** Directory where all output will be generated. */ |
| final String outputDir; |
| + /** |
| + * Whether to print error messages using the json format understood by the |
| + * Dart editor. |
| + */ |
| + final bool jsonFormat; |
| + |
| // We could make this faster, if it ever matters. |
| factory CompilerOptions() => parse(['']); |
| @@ -42,6 +48,7 @@ class CompilerOptions { |
| baseDir = args['basedir'], |
| outputDir = args['out'], |
| forceMangle = args['unique_output_filenames'], |
| + jsonFormat = args['json_format'], |
| inputFile = args.rest.length > 0 ? args.rest[0] : null; |
| static CompilerOptions parse(List<String> arguments) { |
| @@ -60,6 +67,10 @@ class CompilerOptions { |
| 'have the same name as your input files, even if they are in a ' |
| 'different directory', |
| defaultsTo: false, negatable: false) |
| + ..addFlag('json_format', abbr: 'j', |
|
Jennifer Messerly
2012/12/06 04:00:08
I dunno if this one really needs a short option --
Siggi Cherem (dart-lang)
2012/12/06 18:46:42
Done.
|
| + help: 'Print error messsages in a json format easy to parse by tools,' |
| + ' such as the Dart editor', |
| + defaultsTo: false, negatable: false) |
| ..addOption('out', abbr: 'o', help: 'Directory where to generate files' |
| ' (defaults to the same directory as the source file)') |
| ..addOption('basedir', help: 'Base directory where to find all source ' |