Factor out verboseDo to encapsulate magenta output color

This commit is contained in:
Rangi
2026-07-13 18:05:55 -04:00
parent ea3a8ee171
commit 304cbb464f
8 changed files with 59 additions and 95 deletions
+2 -10
View File
@@ -19,7 +19,7 @@
#include "file.hpp"
#include "helpers.hpp"
#include "platform.hpp"
#include "style.hpp"
#include "style.hpp" // style_Parse
#include "usage.hpp"
#include "util.hpp"
#include "verbosity.hpp"
@@ -474,12 +474,6 @@ static void parseArg(int ch, char *arg) {
// LCOV_EXCL_START
static void verboseOutputConfig() {
if (!checkVerbosity(VERB_CONFIG)) {
return;
}
style_Set(stderr, STYLE_MAGENTA, false);
usage.printVersion(true);
printVVVVVVerbosity();
@@ -609,8 +603,6 @@ static void verboseOutputConfig() {
fprintf(stderr, "\tReverse image width: %" PRIu16 " tiles\n", options.reversedWidth);
}
fputs("Ready for conversion\n", stderr);
style_Reset(stderr);
}
// LCOV_EXCL_STOP
@@ -684,7 +676,7 @@ int main(int argc, char *argv[]) {
parseExternalPalSpec(localOptions.externalPalSpec->c_str());
}
verboseOutputConfig(); // LCOV_EXCL_LINE
verboseDo(VERB_CONFIG, verboseOutputConfig);
// Do not do anything if option parsing went wrong.
requireZeroErrors();