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

Unified Diff: dart/lib/compiler/implementation/dart2js.dart

Issue 10910006: Improve detection of when to use colors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 4 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 | « no previous file | dart/utils/compiler/build_helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/lib/compiler/implementation/dart2js.dart
diff --git a/dart/lib/compiler/implementation/dart2js.dart b/dart/lib/compiler/implementation/dart2js.dart
index 9564bad2d8b170b7739126b7cead63aaf8810ff7..bedf1aa00350384a206cfe9a9148d77d3e3d2864 100644
--- a/dart/lib/compiler/implementation/dart2js.dart
+++ b/dart/lib/compiler/implementation/dart2js.dart
@@ -76,7 +76,7 @@ void compile(List<String> argv) {
List<String> options = new List<String>();
bool explicitOut = false;
bool wantHelp = false;
- bool enableColors = true;
+ bool enableColors = false;
passThrough(String argument) => options.add(argument);
@@ -125,7 +125,9 @@ void compile(List<String> argv) {
new OptionHandler('--out=.+|-o.+', setOutput),
new OptionHandler('--allow-mock-compilation', passThrough),
new OptionHandler('--minify', passThrough),
+ // TODO(ahe): Remove the --no-colors option.
new OptionHandler('--no-colors', (_) => enableColors = false),
+ new OptionHandler('--colors', (_) => enableColors = true),
new OptionHandler('--enable[_-]checked[_-]mode|--checked',
(_) => passThrough('--enable-checked-mode')),
new OptionHandler(@'--help|/\?|/h', (_) => wantHelp = true),
@@ -172,7 +174,11 @@ void compile(List<String> argv) {
void info(var message, [api.Diagnostic kind = api.Diagnostic.VERBOSE_INFO]) {
if (!verbose && kind === api.Diagnostic.VERBOSE_INFO) return;
- print('${colors.green("info:")} $message');
+ if (enableColors) {
+ print('${colors.green("info:")} $message');
+ } else {
+ print('info: $message');
+ }
}
bool isAborting = false;
@@ -291,9 +297,10 @@ void compilerMain(Options options) {
}
void help() {
- // This message should be no longer than 22 lines. The default
+ // This message should be no longer than 20 lines. The default
// terminal size normally 80x24. Two lines are used for the prompts
- // before and after running the compiler.
+ // before and after running the compiler. Another two lines may be
+ // used to print an error message.
print('''
Usage: dart2js [options] dartfile
@@ -333,8 +340,8 @@ Supported options:
--suppress-warnings
Do not display any warnings.
- --no-colors
- Do not add colors to diagnostic messages.
+ --colors
+ Add colors to diagnostic messages.
The following options are only used for compiler development and may
be removed in a future version:
« no previous file with comments | « no previous file | dart/utils/compiler/build_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698