| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 options; | 5 library options; |
| 6 | 6 |
| 7 import 'dart:io'; | 7 import 'dart:io'; |
| 8 | 8 |
| 9 import 'package:args/args.dart'; | 9 import 'package:args/args.dart'; |
| 10 | 10 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 return options; | 111 return options; |
| 112 } | 112 } |
| 113 | 113 |
| 114 static CommandLineOptions _parse(List<String> args) { | 114 static CommandLineOptions _parse(List<String> args) { |
| 115 args = args.expand((String arg) => arg.split('=')).toList(); | 115 args = args.expand((String arg) => arg.split('=')).toList(); |
| 116 var parser = new _CommandLineParser() | 116 var parser = new _CommandLineParser() |
| 117 ..addFlag('batch', abbr: 'b', help: 'Run in batch mode', | 117 ..addFlag('batch', abbr: 'b', help: 'Run in batch mode', |
| 118 defaultsTo: false, negatable: false) | 118 defaultsTo: false, negatable: false) |
| 119 ..addOption('dart-sdk', help: 'The path to the Dart SDK') | 119 ..addOption('dart-sdk', help: 'The path to the Dart SDK') |
| 120 ..addOption('package-root', abbr: 'p', | 120 ..addOption('package-root', abbr: 'p', |
| 121 help: 'The path to the package root') | 121 help: 'The path to the package root. The flag package-root is deprecat
ed. Remove to use package information computed by pub.') |
| 122 ..addOption('format', | 122 ..addOption('format', |
| 123 help: 'Specifies the format in which errors are displayed') | 123 help: 'Specifies the format in which errors are displayed') |
| 124 ..addFlag('machine', | 124 ..addFlag('machine', |
| 125 help: 'Print errors in a format suitable for parsing (deprecated)', | 125 help: 'Print errors in a format suitable for parsing (deprecated)', |
| 126 defaultsTo: false, negatable: false) | 126 defaultsTo: false, negatable: false) |
| 127 ..addFlag('version', help: 'Print the analyzer version', | 127 ..addFlag('version', help: 'Print the analyzer version', |
| 128 defaultsTo: false, negatable: false) | 128 defaultsTo: false, negatable: false) |
| 129 ..addFlag('no-hints', help: 'Do not show hint results', | 129 ..addFlag('no-hints', help: 'Do not show hint results', |
| 130 defaultsTo: false, negatable: false) | 130 defaultsTo: false, negatable: false) |
| 131 ..addFlag('ignore-unrecognized-flags', | 131 ..addFlag('ignore-unrecognized-flags', |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 | 330 |
| 331 _getNextFlagIndex(args, i) { | 331 _getNextFlagIndex(args, i) { |
| 332 for ( ; i < args.length; ++i) { | 332 for ( ; i < args.length; ++i) { |
| 333 if (args[i].startsWith('--')) { | 333 if (args[i].startsWith('--')) { |
| 334 return i; | 334 return i; |
| 335 } | 335 } |
| 336 } | 336 } |
| 337 return i; | 337 return i; |
| 338 } | 338 } |
| 339 } | 339 } |
| OLD | NEW |