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

Unified Diff: pkg/analyzer_cli/lib/src/options.dart

Issue 2775633002: Use ansi color in the dartanalyzer cli output. (Closed)
Patch Set: make tests more robust Created 3 years, 9 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer_cli/lib/src/error_formatter.dart ('k') | pkg/analyzer_cli/test/driver_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer_cli/lib/src/options.dart
diff --git a/pkg/analyzer_cli/lib/src/options.dart b/pkg/analyzer_cli/lib/src/options.dart
index 0dfbde4941ac5c7fb65a47ba3fd79df684b6dc09..03909f8f4c2e321485aa0c26a2ab0a675c89bff2 100644
--- a/pkg/analyzer_cli/lib/src/options.dart
+++ b/pkg/analyzer_cli/lib/src/options.dart
@@ -9,6 +9,7 @@ import 'dart:io';
import 'package:analyzer/file_system/physical_file_system.dart';
import 'package:analyzer/src/command_line/arguments.dart';
import 'package:analyzer/src/context/builder.dart';
+import 'package:analyzer_cli/src/ansi.dart' as ansi;
import 'package:analyzer_cli/src/driver.dart';
import 'package:args/args.dart';
import 'package:cli_util/cli_util.dart' show getSdkDir;
@@ -143,6 +144,9 @@ class CommandLineOptions {
/// Emit output in a verbose mode.
final bool verbose;
+ /// Use ANSI color codes for output.
+ final bool color;
+
/// Initialize options from the given parsed [args].
CommandLineOptions._fromArgs(ArgResults args)
: buildAnalysisOutput = args['build-analysis-output'],
@@ -181,7 +185,8 @@ class CommandLineOptions {
lintsAreFatal = args['fatal-lints'],
useAnalysisDriverMemoryByteStore =
args['use-analysis-driver-memory-byte-store'],
- verbose = args['verbose'];
+ verbose = args['verbose'],
+ color = args['color'];
/// The path to an analysis options file
String get analysisOptionsFile =>
@@ -383,6 +388,10 @@ class CommandLineOptions {
help: 'Exit with code 0 even if errors are found.',
defaultsTo: false,
negatable: false,
+ hide: hide)
+ ..addFlag('color',
+ help: 'Use asni colors when printing messages.',
+ defaultsTo: ansi.terminalSupportsAnsi(),
hide: hide);
// Hidden flags.
« no previous file with comments | « pkg/analyzer_cli/lib/src/error_formatter.dart ('k') | pkg/analyzer_cli/test/driver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698