logcat: Map '-C' to 'logcat -v color'
Change-Id: I0419f4551a6dfd77c7d4833050b36da28113ed9b
diff --git a/logcat/logcat.cpp b/logcat/logcat.cpp
index b8c143d..fc96b20 100644
--- a/logcat/logcat.cpp
+++ b/logcat/logcat.cpp
@@ -313,6 +313,7 @@
color descriptive epoch monotonic printable uid usec UTC year zone
Multiple -v parameters or comma separated list of format and format
modifiers are allowed.
+ -C Colored output.
-D, --dividers Print dividers between each log buffer.
-B, --binary Output the log in binary.
@@ -563,6 +564,7 @@
{ "dividers", no_argument, nullptr, 'D' },
{ "file", required_argument, nullptr, 'f' },
{ "format", required_argument, nullptr, 'v' },
+ { "color", no_argument, nullptr, 'C' },
// hidden and undocumented reserved alias for --regex
{ "grep", required_argument, nullptr, 'e' },
// hidden and undocumented reserved alias for --max-count
@@ -586,7 +588,7 @@
};
// clang-format on
- int c = getopt_long(argc, argv, ":cdDhLt:T:gG:sQf:r:n:v:b:BSpP:m:e:", long_options,
+ int c = getopt_long(argc, argv, ":cdDhLt:T:gG:sQf:r:n:v:b:BSpCP:m:e:", long_options,
&option_index);
if (c == -1) break;
@@ -716,6 +718,10 @@
setPruneList = optarg;
break;
+ case 'C':
+ SetLogFormat("color");
+ break;
+
case 'b':
for (const auto& buffer : Split(optarg, delimiters)) {
if (buffer == "default") {