Factor out shared --color-parsing code

This commit is contained in:
Rangi42
2025-08-12 15:53:57 -04:00
parent 7b405513d9
commit 1bf1219e07
6 changed files with 38 additions and 35 deletions

View File

@@ -476,11 +476,7 @@ int main(int argc, char *argv[]) {
case 0:
switch (longOpt) {
case 'c':
if (!strcasecmp(musl_optarg, "always")) {
style_Enable(true);
} else if (!strcasecmp(musl_optarg, "never")) {
style_Enable(false);
} else if (strcasecmp(musl_optarg, "auto")) {
if (!style_Parse(musl_optarg)) {
fatal("Invalid argument for option '--color'");
}
break;