Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 73043a9c authored by Adnan Begovic's avatar Adnan Begovic Committed by Michael Bestas
Browse files

logcat: Map '-C' to 'logcat -v color'

Change-Id: I0419f4551a6dfd77c7d4833050b36da28113ed9b
parent 4f00cdb9
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -492,6 +492,7 @@ static void show_help(android_logcat_context_internal* context) {
                    "                  other pruning activity is oldest first. Special case ~!\n"
                    "                  represents an automatic quicker pruning for the noisiest\n"
                    "                  UID as determined by the current statistics.\n"
                    "  -C              colored output\n"
                    "  -P '<list> ...', --prune='<list> ...'\n"
                    "                  Set prune white and ~black list, using same format as\n"
                    "                  listed above. Must be quoted.\n"
@@ -867,6 +868,7 @@ static int __logcat(android_logcat_context_internal* context) {
          { "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
@@ -890,7 +892,7 @@ static int __logcat(android_logcat_context_internal* context) {
        };
        // 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;

@@ -1058,6 +1060,10 @@ static int __logcat(android_logcat_context_internal* context) {
                setPruneList = optarg;
                break;

            case 'C':
                setLogFormat(context, "color");
            break;

            case 'b': {
                std::unique_ptr<char, void (*)(void*)> buffers(strdup(optarg), free);
                char* arg = buffers.get();