Removed april fools toys (#2325)
diff --git a/lib/src/command_runner.dart b/lib/src/command_runner.dart
index f6b0f1d..8065b78 100644
--- a/lib/src/command_runner.dart
+++ b/lib/src/command_runner.dart
@@ -103,14 +103,6 @@
});
argParser.addFlag('verbose',
abbr: 'v', negatable: false, help: 'Shortcut for "--verbosity=all".');
- argParser.addFlag('with-prejudice',
- hide: !isAprilFools,
- negatable: false,
- help: 'Execute commands with prejudice.');
- argParser.addFlag('sparkle',
- hide: !isAprilFools,
- negatable: false,
- help: 'A more sparkly experience.');
addCommand(BuildCommand());
addCommand(CacheCommand());
@@ -142,9 +134,6 @@
@override
Future runCommand(ArgResults topLevelResults) async {
- log.withPrejudice = topLevelResults['with-prejudice'];
- log.sparkle = topLevelResults['sparkle'];
-
_checkDepsSynced();
if (topLevelResults['version']) {
diff --git a/lib/src/io.dart b/lib/src/io.dart
index 9864049..0303e11 100644
--- a/lib/src/io.dart
+++ b/lib/src/io.dart
@@ -585,7 +585,7 @@
if (runningFromTest) {
log.message('$message (y/N)?');
} else {
- stdout.write(log.format('$message (y/N)? '));
+ stdout.write('$message (y/N)? ');
}
return _stdinLines.first.then(RegExp(r'^[yY]').hasMatch);
}
diff --git a/lib/src/log.dart b/lib/src/log.dart
index 215109a..ebaa8a5 100644
--- a/lib/src/log.dart
+++ b/lib/src/log.dart
@@ -26,12 +26,6 @@
/// The current logging verbosity.
Verbosity verbosity = Verbosity.NORMAL;
-/// Whether or not to log entries with prejudice.
-bool withPrejudice = false;
-
-/// Whether or not to log entries sparklily.
-bool sparkle = false;
-
/// In cases where there's a ton of log spew, make sure we don't eat infinite
/// memory.
///
@@ -54,15 +48,13 @@
final _magenta = getSpecial('\u001b[35m');
final _red = getSpecial('\u001b[31m');
final _yellow = getSpecial('\u001b[33m');
-final _blue = getSpecial('\u001b[34m');
+//final _blue = getSpecial('\u001b[34m');
final _gray = getSpecial('\u001b[38;5;245m');
+
final _none = getSpecial('\u001b[0m');
final _noColor = getSpecial('\u001b[39m');
final _bold = getSpecial('\u001b[1m');
-/// All color codes.
-final _allColors = [_cyan, _green, _magenta, _red, _yellow, _blue, ''];
-
/// An enum type for defining the different logging levels a given message can
/// be associated with.
///
@@ -236,7 +228,7 @@
lines.removeLast();
}
- var entry = _Entry(level, lines.map(format).toList());
+ var entry = _Entry(level, lines);
var logFn = verbosity._loggers[level];
if (logFn != null) logFn(entry);
@@ -244,30 +236,6 @@
if (_transcript != null) _transcript.add(entry);
}
-final _capitalizedAnsiEscape = RegExp(r'\u001b\[\d+(;\d+)?M');
-
-/// Returns [string] formatted as it would be if it were logged.
-String format(String string) {
- if (sparkle) {
- string = string.replaceAllMapped(RegExp(r'.'), (match) {
- var char = '${choose(_allColors)}${match[0]}$_noColor';
- return (withPrejudice || random.nextBool()) ? char : '$_bold$char$_none';
- });
- }
-
- if (withPrejudice) {
- // [toUpperCase] can corrupt terminal colorings, so fix them up using
- // [replaceAllMapped].
- string = string.toUpperCase().replaceAllMapped(
- _capitalizedAnsiEscape, (match) => match[0].toLowerCase());
-
- // Don't use [bold] because it's disabled under [withPrejudice].
- string = '$_bold$string$_none';
- }
-
- return string;
-}
-
/// Logs the spawning of an [executable] process with [arguments] at [IO]
/// level.
void process(
@@ -444,21 +412,13 @@
/// that supports that.
///
/// Use this to highlight the most important piece of a long chunk of text.
-///
-/// This is disabled under [withPrejudice] since all text is bold with
-/// prejudice.
-String bold(text) => (withPrejudice || sparkle) ? '$text' : '$_bold$text$_none';
+String bold(text) => '$_bold$text$_none';
/// Wraps [text] in the ANSI escape codes to make it gray when on a platform
/// that supports that.
///
/// Use this for text that's less important than the text around it.
-///
-/// The gray marker also enables bold, so it needs to be handled specially with
-/// [withPrejudice] to avoid disabling bolding entirely.
String gray(text) {
- if (sparkle) return '$text';
- if (withPrejudice) return '$_gray$text$_noColor';
return '$_gray$text$_none';
}
@@ -498,7 +458,6 @@
///
/// This is resilient to the text containing other colors or bold text.
String _addColor(Object text, String colorCode) {
- if (sparkle) return text.toString();
return colorCode +
text
.toString()
diff --git a/lib/src/progress.dart b/lib/src/progress.dart
index d05c361..c97d329 100644
--- a/lib/src/progress.dart
+++ b/lib/src/progress.dart
@@ -54,7 +54,7 @@
_update();
});
- stdout.write(log.format('$_message... '));
+ stdout.write('$_message... ');
}
/// Stops the progress indicator.
diff --git a/lib/src/utils.dart b/lib/src/utils.dart
index 2973b4d..8ca09b7 100644
--- a/lib/src/utils.dart
+++ b/lib/src/utils.dart
@@ -234,9 +234,6 @@
}
}
-/// Randomly chooses a single element in [elements].
-T choose<T>(List<T> elements) => elements[random.nextInt(elements.length)];
-
/// Returns a list containing the sorted elements of [iter].
List<T> ordered<T extends Comparable<T>>(Iterable<T> iter) {
var list = iter.toList();
@@ -437,15 +434,6 @@
return lines.join('\n');
}
-/// Whether today is April Fools' day.
-bool get isAprilFools {
- // Tests should never see April Fools' output.
- if (runningFromTest) return false;
-
- var date = DateTime.now();
- return date.month == 4 && date.day == 1;
-}
-
/// The subset of strings that don't need quoting in YAML.
///
/// This pattern does not strictly follow the plain scalar grammar of YAML,