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

Unverified Commit a3fb0d9c 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 484418c6
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -489,6 +489,7 @@ static void show_help(android_logcat_context_internal* context) {
                    "                  other pruning activity is oldest first. Special case ~!\n"
                    "                  other pruning activity is oldest first. Special case ~!\n"
                    "                  represents an automatic quicker pruning for the noisiest\n"
                    "                  represents an automatic quicker pruning for the noisiest\n"
                    "                  UID as determined by the current statistics.\n"
                    "                  UID as determined by the current statistics.\n"
                    "  -C              colored output\n"
                    "  -P '<list> ...', --prune='<list> ...'\n"
                    "  -P '<list> ...', --prune='<list> ...'\n"
                    "                  Set prune white and ~black list, using same format as\n"
                    "                  Set prune white and ~black list, using same format as\n"
                    "                  listed above. Must be quoted.\n"
                    "                  listed above. Must be quoted.\n"
@@ -878,6 +879,7 @@ static int __logcat(android_logcat_context_internal* context) {
          { "dividers",      no_argument,       nullptr, 'D' },
          { "dividers",      no_argument,       nullptr, 'D' },
          { "file",          required_argument, nullptr, 'f' },
          { "file",          required_argument, nullptr, 'f' },
          { "format",        required_argument, nullptr, 'v' },
          { "format",        required_argument, nullptr, 'v' },
          { "color",         no_argument,       NULL,   'C' },
          // hidden and undocumented reserved alias for --regex
          // hidden and undocumented reserved alias for --regex
          { "grep",          required_argument, nullptr, 'e' },
          { "grep",          required_argument, nullptr, 'e' },
          // hidden and undocumented reserved alias for --max-count
          // hidden and undocumented reserved alias for --max-count
@@ -901,7 +903,7 @@ static int __logcat(android_logcat_context_internal* context) {
        };
        };
        // clang-format on
        // clang-format on


        ret = getopt_long_r(argc, argv, ":cdDhLt:T:gG:sQf:r:n:v:b:BSpP:m:e:",
        ret = getopt_long_r(argc, argv, ":cdDhLt:T:gG:sQf:r:n:v:b:BSpCP:m:e:",
                            long_options, &option_index, &optctx);
                            long_options, &option_index, &optctx);
        if (ret < 0) break;
        if (ret < 0) break;


@@ -1081,6 +1083,10 @@ static int __logcat(android_logcat_context_internal* context) {
                setPruneList = optctx.optarg;
                setPruneList = optctx.optarg;
                break;
                break;


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

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