Skip to content

Commit

Permalink
Allow suppressing known/unknown file warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
dillof committed May 10, 2024
1 parent 1094628 commit 475997c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
2 changes: 2 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

- status update: SIGINFO support in Archive::commit, via libzip progress callback

- search loose files in zipped mode: Add option in ArchiveDir to ignore zip files, but keep in .ckmame.db.

- speedup idea: when opening archives (in extra dirs) only compute hashes if we need them

- `mkmamedb`: When a game is in two dat files (identical name and ROMs), skip it from second (with warning).
Expand Down
24 changes: 22 additions & 2 deletions src/Configuration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ TomlSchema::TypePtr Configuration::section_schema = TomlSchema::table({
{ "use-description-as-name", TomlSchema::boolean() },
{ "use-temp-directory", TomlSchema::boolean() },
{ "use-torrentzip", TomlSchema::boolean() },
{ "verbose", TomlSchema::boolean() }
{ "verbose", TomlSchema::boolean() },
{ "warn-file-known", TomlSchema::boolean() },
{ "warn-file-unknown", TomlSchema::boolean() }
}, {});


Expand Down Expand Up @@ -172,7 +174,9 @@ std::vector<Commandline::Option> Configuration::commandline_options = {
Commandline::Option("use-description-as-name", "use description as name of games in ROM database"),
Commandline::Option("use-temp-directory", 't', "create output in temporary directory, move when done"),
Commandline::Option("use-torrentzip", "use TORRENTZIP format for zip archives in ROM set"),
Commandline::Option("verbose", 'v', "print fixes made")
Commandline::Option("verbose", 'v', "print fixes made"),
Commandline::Option("warn-file-known", "report status of extra files that are known (default)"),
Commandline::Option("warn-file-unknown", "report status of extra files that are unknown (default)")
};


Expand All @@ -189,6 +193,8 @@ std::unordered_map<std::string, std::string> Configuration::option_to_variable =
{ "no-report-summary", "report_summary" },
{ "no-report-no-good-dump", "report_no_good_dump" },
{ "no-update-database", "update_database" },
{ "no-warn-file-known", "warn-file-known"},
{ "no-warn-file-unknown", "warn-file-unknown"},
{ "roms-unzipped", "roms_zipped" }
};

Expand Down Expand Up @@ -440,6 +446,12 @@ void Configuration::prepare(const std::string &current_set, const ParsedCommandl
else if (option.name == "no-update-database") {
update_database = false;
}
else if (option.name == "no-warn-file-known") {
warn_file_known = false;
}
else if (option.name == "no-warn-file-unknown") {
warn_file_unknown = false;
}
else if (option.name == "old-db") {
old_db = option.argument;
}
Expand Down Expand Up @@ -494,6 +506,12 @@ void Configuration::prepare(const std::string &current_set, const ParsedCommandl
else if (option.name == "verbose") {
verbose = true;
}
else if (option.name == "warn-file-known") {
warn_file_known = true;
}
else if (option.name == "warn-file-unknown") {
warn_file_unknown = true;
}
}
}

Expand Down Expand Up @@ -559,6 +577,8 @@ void Configuration::merge_config_table(const toml::table *table_pointer) {
set_bool(table, "use-temp-directory", use_temp_directory);
set_bool(table, "use-torrentzip", use_torrentzip);
set_bool(table, "verbose", verbose);
set_bool(table, "warn-file-known", warn_file_known);
set_bool(table, "warn-file-unknown", warn_file_unknown);
}


Expand Down
4 changes: 3 additions & 1 deletion src/ckmame.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ std::unordered_set<std::string> ckmame_used_variables = {
"unknown_directory",
"update_database",
"use_torrentzip",
"verbose"
"verbose",
"warn_file_known",
"warn_file_unknown"
};

static bool contains_romdir(const std::string &ame);
Expand Down

0 comments on commit 475997c

Please sign in to comment.