Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Side by Side Diff: lib/src/options.dart

Issue 1412293005: Defer to engine for option-aware context config. (Closed) Base URL: https://github.com/dart-lang/analyzer_cli.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/src/driver.dart ('k') | pubspec.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 analyzer_cli.src.options; 5 library analyzer_cli.src.options;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 import 'package:analyzer_cli/src/driver.dart';
9 import 'package:args/args.dart'; 10 import 'package:args/args.dart';
10 import 'package:cli_util/cli_util.dart' show getSdkDir; 11 import 'package:cli_util/cli_util.dart' show getSdkDir;
11 12
12 const _binaryName = 'dartanalyzer'; 13 const _binaryName = 'dartanalyzer';
13 14
14 /// Shared exit handler. 15 /// Shared exit handler.
15 /// 16 ///
16 /// *Visible for testing.* 17 /// *Visible for testing.*
17 ExitHandler exitHandler = exit; 18 ExitHandler exitHandler = exit;
18 19
19 /// Print the given message to stderr and exit with the given [exitCode] 20 /// Print the given message to stderr and exit with the given [exitCode]
20 void printAndFail(String message, {int exitCode: 15}) { 21 void printAndFail(String message, {int exitCode: 15}) {
21 stderr.writeln(message); 22 errorSink.writeln(message);
22 exitHandler(exitCode); 23 exitHandler(exitCode);
23 } 24 }
24 25
25 /// Exit handler. 26 /// Exit handler.
26 /// 27 ///
27 /// *Visible for testing.* 28 /// *Visible for testing.*
28 typedef void ExitHandler(int code); 29 typedef void ExitHandler(int code);
29 30
30 /// Analyzer commandline configuration options. 31 /// Analyzer commandline configuration options.
31 class CommandLineOptions { 32 class CommandLineOptions {
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 485
485 int _getNextFlagIndex(args, i) { 486 int _getNextFlagIndex(args, i) {
486 for (; i < args.length; ++i) { 487 for (; i < args.length; ++i) {
487 if (args[i].startsWith('--')) { 488 if (args[i].startsWith('--')) {
488 return i; 489 return i;
489 } 490 }
490 } 491 }
491 return i; 492 return i;
492 } 493 }
493 } 494 }
OLDNEW
« no previous file with comments | « lib/src/driver.dart ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698