diff --git a/SabreTools.Helper/Dats/Filter.cs b/SabreTools.Helper/Dats/Filter.cs index 1bdeaf4c..59bd4e6a 100644 --- a/SabreTools.Helper/Dats/Filter.cs +++ b/SabreTools.Helper/Dats/Filter.cs @@ -118,11 +118,11 @@ namespace SabreTools.Helper.Dats public bool ItemPasses(DatItem item, Logger logger) { // Filter on machine type - if (_machineType != MachineType.NULL && item.Machine.MachineType != _machineType) + if (_machineType != MachineType.NULL && (item.Machine.MachineType & _machineType) == 0) { return false; } - if (_machineNotType != MachineType.NULL && item.Machine.MachineType == _machineNotType) + if (_machineNotType != MachineType.NULL && (item.Machine.MachineType & _machineNotType) != 0) { return false; } @@ -139,11 +139,11 @@ namespace SabreTools.Helper.Dats Rom rom = (Rom)item; // Filter on status - if (_itemStatus != ItemStatus.NULL && rom.ItemStatus != _itemStatus) + if (_itemStatus != ItemStatus.NULL && (rom.ItemStatus & _itemStatus) == 0) { return false; } - if (_itemNotStatus != ItemStatus.NULL && rom.ItemStatus == _itemNotStatus) + if (_itemNotStatus != ItemStatus.NULL && (rom.ItemStatus & _itemNotStatus) != 0) { return false; } @@ -362,11 +362,11 @@ namespace SabreTools.Helper.Dats Disk rom = (Disk)item; // Filter on status - if (_itemStatus != ItemStatus.NULL && rom.ItemStatus != _itemStatus) + if (_itemStatus != ItemStatus.NULL && (rom.ItemStatus & _itemStatus) == 0) { return false; } - if (_itemNotStatus != ItemStatus.NULL && rom.ItemStatus == _itemNotStatus) + if (_itemNotStatus != ItemStatus.NULL && (rom.ItemStatus & _itemNotStatus) != 0) { return false; } diff --git a/SabreTools.Helper/README.1ST b/SabreTools.Helper/README.1ST index e12cb91f..80c22592 100644 --- a/SabreTools.Helper/README.1ST +++ b/SabreTools.Helper/README.1ST @@ -840,18 +840,22 @@ Options: -is=, --status= Include only items with a given status Include items with one of the supported values: None, Good, BadDump, Nodump, Verified + Multiples of this input are allowed. -nis=, --not-status= Exclude only items with a given status Exclude items with one of the supported values: None, Good, BadDump, Nodump, Verified + Multiples of this input are allowed. -gt=, --game-type= Include only items with the given game type Include items with one of the supported values: None, Bios, Device, Mechanical + Multiples of this input are allowed. -ngt=, --not-gtype= Exclude only items with a given game type Exclude items with one of the supported values: None, Bios, Device, Mechanical + Multiples of this input are allowed. -run, --runnable Include only items that are marked runnable This allows users to include only verified runnable games diff --git a/SabreTools/Partials/SabreTools_Inits.cs b/SabreTools/Partials/SabreTools_Inits.cs index 2d8fe1e4..6bed2a9f 100644 --- a/SabreTools/Partials/SabreTools_Inits.cs +++ b/SabreTools/Partials/SabreTools_Inits.cs @@ -541,7 +541,6 @@ namespace SabreTools switch (forcemerge?.ToLowerInvariant()) { case "none": - default: fm = ForceMerging.None; break; case "split": @@ -550,13 +549,15 @@ namespace SabreTools case "full": fm = ForceMerging.Full; break; + default: + _logger.Warning(forcemerge + " is not a valid merge flag"); + break; } ForceNodump fn = ForceNodump.None; switch (forcend?.ToLowerInvariant()) { case "none": - default: fn = ForceNodump.None; break; case "obsolete": @@ -568,13 +569,15 @@ namespace SabreTools case "ignore": fn = ForceNodump.Ignore; break; + default: + _logger.Warning(forcend + " is not a valid nodump flag"); + break; } ForcePacking fp = ForcePacking.None; switch (forcepack?.ToLowerInvariant()) { case "none": - default: fp = ForcePacking.None; break; case "zip": @@ -583,6 +586,9 @@ namespace SabreTools case "unzip": fp = ForcePacking.Unzip; break; + default: + _logger.Warning(forcepack + " is not a valid packing flag"); + break; } // Set the status flag for filtering @@ -606,6 +612,9 @@ namespace SabreTools case "verified": itemStatus |= ItemStatus.Verified; break; + default: + _logger.Warning(status + " is not a valid status"); + break; } } @@ -630,6 +639,9 @@ namespace SabreTools case "verified": itemNotStatus |= ItemStatus.Verified; break; + default: + _logger.Warning(status + " is not a valid status"); + break; } } @@ -653,6 +665,9 @@ namespace SabreTools case "mechanical": machineType |= MachineType.Mechanical; break; + default: + _logger.Warning(gametype + " is not a valid type"); + break; } } @@ -676,6 +691,9 @@ namespace SabreTools case "mechanical": machineNotType = MachineType.Mechanical; break; + default: + _logger.Warning(gametype + " is not a valid type"); + break; } }