Have the -romident command skip the matching process and issue an error message when no files are found

This commit is contained in:
AJR 2020-05-30 13:07:31 -04:00
parent 4b4cfed14d
commit dfd0305ca3
2 changed files with 6 additions and 1 deletions

View File

@ -1452,7 +1452,9 @@ void cli_frontend::romident(const std::vector<std::string> &args)
ident.identify(filename);
// return the appropriate error code
if (ident.matches() == ident.total())
if (ident.total() == 0)
throw emu_fatalerror(EMU_ERR_MISSING_FILES, "No files found.\n");
else if (ident.matches() == ident.total())
return;
else if (ident.matches() == ident.total() - ident.nonroms())
throw emu_fatalerror(EMU_ERR_IDENT_NONROMS, "Out of %d files, %d matched, %d are not roms.\n", ident.total(), ident.matches(), ident.nonroms());

View File

@ -332,6 +332,9 @@ void media_identifier::digest_data(std::vector<file_info> &info, char const *nam
void media_identifier::match_hashes(std::vector<file_info> &info)
{
if (info.empty())
return;
auto match_device =
[&info, listnames = std::unordered_set<std::string>()] (device_t &device) mutable
{