Warn about rgbgfx -O without -o or any of -A -T -P -Q

This commit is contained in:
Rangi42
2025-09-20 20:21:37 -04:00
parent 595c87b2f8
commit e7f5ab3f55
3 changed files with 15 additions and 0 deletions

View File

@@ -44,6 +44,8 @@ static struct LocalOptions {
bool autoPalmap;
bool groupOutputs;
bool reverse;
bool autoAny() const { return autoAttrmap || autoTilemap || autoPalettes || autoPalmap; }
} localOptions;
// Short options
@@ -846,6 +848,16 @@ int main(int argc, char *argv[]) {
);
}
if (localOptions.groupOutputs) {
if (!localOptions.autoAny()) {
warnx("Grouping outputs ('-O') is enabled, but without any automatic output paths "
"('-A', '-P', '-Q', or '-T')");
}
if (options.output.empty()) {
warnx("Grouping outputs ('-O') is enabled, but without an output tile data file ('-o')"
);
}
}
auto autoOutPath = [](bool autoOptEnabled, std::string &path, char const *extension) {
if (!autoOptEnabled) {
return;