From 2e67c74c5424b27df0461056bb4041fa5833982b Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Mon, 8 Jan 2018 12:19:20 -0800 Subject: [PATCH] [SabreTools, Filter] Update list and string flags --- SabreTools.Library/DatFiles/Filter.cs | 12 +- SabreTools.Library/README.1ST | 97 +++--- SabreTools/SabreTools.Help.cs | 428 +++++++++++++------------- SabreTools/SabreTools.cs | 226 +++++++------- 4 files changed, 400 insertions(+), 363 deletions(-) diff --git a/SabreTools.Library/DatFiles/Filter.cs b/SabreTools.Library/DatFiles/Filter.cs index 5728c12b..65886ade 100644 --- a/SabreTools.Library/DatFiles/Filter.cs +++ b/SabreTools.Library/DatFiles/Filter.cs @@ -71,17 +71,17 @@ namespace SabreTools.Library.DatFiles #region Positive - public List GameNames + public List MachineNames { get { return _gameNames; } set { _gameNames = value; } } - public List RomNames + public List ItemNames { get { return _romNames; } set { _romNames = value; } } - public List RomTypes + public List ItemTypes { get { return _romTypes; } set { _romTypes = value; } @@ -131,17 +131,17 @@ namespace SabreTools.Library.DatFiles #region Negative - public List NotGameNames + public List NotMachineNames { get { return _notGameNames; } set { _notGameNames = value; } } - public List NotRomNames + public List NotItemNames { get { return _notRomNames; } set { _notRomNames = value; } } - public List NotRomTypes + public List NotItemTypes { get { return _notRomTypes; } set { _notRomTypes = value; } diff --git a/SabreTools.Library/README.1ST b/SabreTools.Library/README.1ST index 936b66a8..434a3940 100644 --- a/SabreTools.Library/README.1ST +++ b/SabreTools.Library/README.1ST @@ -196,7 +196,7 @@ Options: Normally, the DAT will be created with the date in the file name. This flag removes that but keeps the date tag intact. - -fp=, --forcepack= Set force packing + -fp=, --forcepacking= Set force packing Set the forcepacking flag to one of the supported values: None, Zip, Unzip @@ -282,11 +282,11 @@ Options: Set the internal name for the output DAT(s) [default is folder name plus date] - -de=, --desc= Set the description of the DAT + -de=, --description= Set the description of the DAT Set the description for the output DAT(s) [default is the folder name] - -c=, --cat= Set the category of the DAT + -c=, --category= Set the category of the DAT Set the category for the output DAT(s) [default is blank] -v=, --version= Set the version of the DAT @@ -355,11 +355,11 @@ Options: temp directory (inside the running folder) is not preferred. This is used for any operations that require an archive to be extracted. - -out= Set the name of the output directory + -out=, --output-dir= Set the name of the output directory This sets an output folder to be used when the files are created. If a path is not defined, the application directory is used instead. - -mt={4} Amount of threads to use + -mt=, --threads= Amount of threads to use Optionally, set the number of threads to use for the multithreaded operations. The default is 4 threads; -1 means unlimited threads created. If the user specifies that only 1 thread is to be used, it @@ -382,7 +382,7 @@ Options: - Nintendo Super Famicom / Super Nintendo Entertainment System - Nintendo Super Famicom / Super Nintendo Entertainment System SPC - -out= Set the name of the output directory + -out=, --output-dir= Set the name of the output directory This sets an output folder to be used when the files are created. If a path is not defined, the application directory is used instead. @@ -407,7 +407,7 @@ Options: - Nintendo Super Famicom / Super Nintendo Entertainment System - Nintendo Super Famicom / Super Nintendo Entertainment System SPC - -out= Set the name of the output directory + -out=, --output-dir= Set the name of the output directory This sets an output folder to be used when the files are created. If a path is not defined, the application directory is used instead. @@ -474,7 +474,7 @@ Options: -ox, -output-xml Output in Logiqx XML format Add outputting the created DAT to Logiqx XML format - -out= Set the name of the output directory + -out=, --output-dir= Set the name of the output directory This sets an output folder to be used when the files are created. If a path is not defined, the application directory is used instead. @@ -545,7 +545,7 @@ Options: The user-supplied DAT used to check which files need to be rebuilt. Multiple occurrences of this flag are allowed. - -out= Set the name of the output directory + -out=, --output-dir= Set the name of the output directory This sets an output folder to be used when the files are created. If a path is not defined, the application directory is used instead. @@ -710,7 +710,7 @@ Options: parent sets based on the cloneof and romof tags as well as device references. This is incompatible with the other --dat-X flags. - -mt={4} Amount of threads to use + -mt=, --threads= Amount of threads to use Optionally, set the number of threads to use for the multithreaded operations. The default is 4 threads; -1 means unlimited threads created. If the user specifies that only 1 thread is to be used, it @@ -746,7 +746,7 @@ Options: -f=, --filename= Set the filename for the output Set the filename (without extension) for the outputted report - -out= Set the name of the output directory + -out=, --output-dir= Set the name of the output directory This sets an output folder to be used when the files are created. If a path is not defined, the application directory is used instead. @@ -846,10 +846,10 @@ Options: -q, --quotes Put double-quotes around each item This quotes only the item and not the prefix and postfix - -ae=, --add-ext= Add an extension to each item + -ae=, --add-extension= Add an extension to each item To each item, a postfixed extension is added - -re=, --rep-ext= Replace all extensions with specified + -re=, --replace-extension= Replace all extensions with specified When an extension exists, replace it with the provided instead -rme, --remove-extensions Remove all extensions from all items @@ -946,13 +946,13 @@ Options: -n=, --name= Set the internal name of the DAT Set the internal name for the output DAT(s) - -de=, --desc= Set the description of the DAT + -de=, --description= Set the description of the DAT Set the description for the output DAT(s) -r=, --root= Set a new rootdir Set the rootdir (as used by SuperDAT mode) for the output DAT(s) - -c=, --cat= Set the category of the DAT + -c=, --category= Set the category of the DAT Set the category for the output DAT(s) -v=, --version= Set the version of the DAT @@ -982,15 +982,15 @@ Options: -sd, --superdat Enable SuperDAT creation Set the type flag to "SuperDAT" for the output DAT - -fm=, --forcemerge= Set force merging - Set the forcemerge tag to one of the supported values: - None, Split, Full + -fm=, --forcemerging= Set force merging + Set the forcemerging tag to one of the supported values: + None, Split, Merged, Nonmerged, Full - -fn=, --forcend= Set force nodump + -fn=, --forcenodump= Set force nodump Set the forcenodump tag to one of the supported values: None, Obsolete, Required, Ignore - -fp=, --forcepack= Set force packing + -fp=, --forcepacking= Set force packing Set the forcepacking flag to one of the supported values: None, Zip, Unzip @@ -1179,10 +1179,10 @@ Options: This flag enables updating of machine manufacturers from base DATs - -gn=, --not-game= Filter by game name - -ngn=, --game-name= Exclude by game name - -rn=, --rom-name= Filter by rom name - -nrn=, --not-rom= Exclude by rom name + -gn=, --game-name= Filter by game name + -ngn=, --not-game-name= Exclude by game name + -rn=, --item-name= Filter by item name + -nrn=, --not-item-name= Exclude by item name -crc=, --crc= Filter by CRC hash -ncrc=, --not-crc= Exclude by CRC hash -md5=, --md5= Filter by MD5 hash @@ -1205,11 +1205,11 @@ Options: well. This can allow for more advanced set-building, especially in arcade-based sets. - -rt=, --rom-type= Filter by rom type + -rt=, --item-type= Filter by item type This allows users to only include roms or disks to their liking. Multiples of this input are allowed. - -nrt=, --not-type= Exclude by rom type + -nrt=, --not-item-type= Exclude by item type This allows users to only exclude roms or disks to their liking. Multiples of this input are allowed. @@ -1235,7 +1235,7 @@ Options: None, Bios, Device, Mechanical Multiples of this input are allowed. - -ngt=, --not-gtype= Exclude only items with a given game type + -ngt=, --not-game-type= 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. @@ -1246,7 +1246,7 @@ Options: -nrun, --not-runnable Include only items that are not marked runnable This allows users to include only unrunnable games - -out= Set the name of the output directory + -out=, --output-dir= Set the name of the output directory This sets an output folder to be used when the files are created. If a path is not defined, the application directory is used instead. @@ -1257,7 +1257,7 @@ Options: to how file are expected to be written. This flag is only valid for Update and Cascade operations. - -mt={4} Amount of threads to use + -mt=, --threads= Amount of threads to use Optionally, set the number of threads to use for the multithreaded operations. The default is 4 threads; -1 means unlimited threads created. If the user specifies that only 1 thread is to be used, it @@ -1339,7 +1339,8 @@ users of SabreTools. Thanks to Kludge for most of these suggestions! Convert a DAT file to XML and put it in a new folder Long form: - SabreTools.exe --update --output-xml --out=OutDir Path\To\DatFile.dat + SabreTools.exe --update --output-xml --output-dir==OutDir + Path\To\DatFile.dat Short form: SabreTools.exe -ud -ox -out=OutDir DatFile.dat Path\To\DatFile.dat @@ -1368,7 +1369,8 @@ users of SabreTools. Thanks to Kludge for most of these suggestions! and outputting in TorrentZip format Long form: - SabreTools.exe --sort --dat=Fix.dat --tzip --out=FixDir InDir1 InDir2 + SabreTools.exe --sort --dat=Fix.dat --tzip --output-dir==FixDir InDir1 + InDir2 Short form: SabreTools.exe -ss -dat=Fix.dat -tzip -out=FixDir InDir2 InDir2 @@ -1414,41 +1416,56 @@ more details. This section contains remappings from old flag names to new ones for the purposes of testing -ab, --add-blank -> -ab, --add-blank-files --bc, --baddump-col -> -bc, --baddump-column +-ae, --add-ext -> -ae, --add-extension -b, --bare -> -b, --no-automatic-date --dnd, --dat-devnonmerged -> -dnd, --dat-device-non-merged --df, --dat-fullnonmerged -> -df, --dat-full-non-merged --dnm, --dat-nonmerged -> -dnm, --dat-non-merged +-bc, --baddump-col -> -bc, --baddump-column +-c, --cat -> -c, --category -dan, --desc-name -> -dan, --description-as-name +-de, --desc -> -de, --description +-df, --dat-fullnonmerged -> -df, --dat-full-non-merged +-dnd, --dat-devnonmerged -> -dnd, --dat-device-non-merged +-dnm, --dat-nonmerged -> -dnm, --dat-non-merged -es, --ext -> -es, --extension -f, --files -> -f, --archives-as-files +-fm, --forcemerge -> -fm, --forcemerging +-fn, --forcend -> -fn, --forcenodump +-fp, --forcepack -> -fp, --forcepacking -ic, --ignore-chd -> -ic, --chds-as-files +-mt, --mt -> -mt, --threads -nc, --nodump-col -> -nc, --nodump-column +-ngn, --not-game -> -ngn, --not-game-name +-ngt, --not-gtype -> -ngt, --not-game-type +-nrn, --not-rom -> -nrn, --not-rom-name -nm, --noMD5 -> -nm, --skip-md5 +-nrt, --not-type -> -nrt, --not-item-type +-nrun, --not-run -> -nrun, --not-runnable -ns, --noSHA1 -> -ns, --skip-sha1 -ns256, --noSHA256 -> -ns256, --skip-sha256 -ns384, --noSHA384 -> -nm, --skip-sha384 -ns512, --noSHA512 -> -nm, --skip-sha512 --nrun, --not-run -> -nrun, --not-runnable --ofg, --of-as-game -> -ofg, --match-of-tags -oam, --output-am -> -oam, --output-attractmode -od, --output-dc -> -od, --output-doscenter +-ofg, --of-as-game -> -ofg, --match-of-tags -olr, --output-lr -> -olr, --output-listrom -ool, --output-ol -> -ol, --output-offlinelist -or, --output-rc -> -or, --output-romcenter -os, --output-sd -> -os, --output-sabredat -osl, --output-sl -> -osl, --output-softwarelist --rme, --rem-ext -> -rme, --remove-extensions +-out, --out -> -out, --output-dir +-rc, --rev-cascade -> -rc, --reverse-cascade +-rep, --rep-ext -> -rep, --replace-extension -rmd5, --rem-md5 -> -rmd5, --remove-md5 +-rme, --rem-ext -> -rme, --remove-extensions +-rn, --rom-name -> -rn, --item-name -rsha1, --rem-sha1 -> -rsha1, --remove-sha1 -rsha256, --rem-sha256 -> -rsha256, --remove-sha256 -rsha384, --rem-sha384 -> -rsha384, --remove-sha384 -rsha512, --rem-sha512 -> -rsha512, --remove-sha512 +-rt, --rom-type -> -rt, --item-type -ru, --rem-uni -> -ru, --remove-unicode --rc, --rev-cascade -> -rc, --reverse-cascade +-sf, --skip -> -sf, --skip-first-output -si, --single -> -ind, --individual [For stat output case] -si, --single -> -si, --single-set [For '!' case] --sf, --skip -> -sf, --skip-first-output -ska, --skiparc -> -ska, --skip-archives -skf, --skipfile -> -skf, --skip-files -t7z, --t7z -> -t7z, --torrent-7zip diff --git a/SabreTools/SabreTools.Help.cs b/SabreTools/SabreTools.Help.cs index 3e5de1c3..3fe00b89 100644 --- a/SabreTools/SabreTools.Help.cs +++ b/SabreTools/SabreTools.Help.cs @@ -1220,7 +1220,7 @@ namespace SabreTools #region Private Int32 features - private static Feature gzFeature + private static Feature gzInt32Input { get { @@ -1231,18 +1231,7 @@ namespace SabreTools null); } } - private static Feature mtFeature - { - get - { - return new Feature( - new List() { "-mt", "--mt" }, - "Amount of threads to use (default = # cores, -1 unlimted)", - FeatureType.Int32, - null); - } - } - private static Feature rarFeature + private static Feature rarInt32Input { get { @@ -1253,7 +1242,7 @@ namespace SabreTools null); } } - private static Feature sevenZipFeature + private static Feature sevenZipInt32Input { get { @@ -1264,7 +1253,18 @@ namespace SabreTools null); } } - private static Feature zipFeature + private static Feature threadsInt32Input + { + get + { + return new Feature( + new List() { "-mt", "--threads" }, + "Amount of threads to use (default = # cores, -1 unlimted)", + FeatureType.Int32, + null); + } + } + private static Feature zipInt32Input { get { @@ -1285,7 +1285,7 @@ namespace SabreTools #region Private List features - private static Feature baseDatFeature + private static Feature baseDatListInput { get { @@ -1296,7 +1296,7 @@ namespace SabreTools null); } } - private static Feature crcFeature + private static Feature crcListInput { get { @@ -1307,7 +1307,7 @@ namespace SabreTools null); } } - private static Feature datFeature + private static Feature datListInput { get { @@ -1318,7 +1318,7 @@ namespace SabreTools null); } } - private static Feature extaFeature + private static Feature extaListInput { get { @@ -1329,7 +1329,7 @@ namespace SabreTools null); } } - private static Feature extbFeature + private static Feature extbListInput { get { @@ -1340,7 +1340,7 @@ namespace SabreTools null); } } - private static Feature gameNameFeature + private static Feature gameNameListInput { get { @@ -1351,7 +1351,7 @@ namespace SabreTools null); } } - private static Feature gameTypeFeature + private static Feature gameTypeListInput { get { @@ -1366,7 +1366,29 @@ namespace SabreTools }); } } - private static Feature md5Feature + private static Feature itemNameListInput + { + get + { + return new Feature( + new List() { "-rn", "--item-name" }, + "Filter by item name", + FeatureType.List, + null); + } + } + private static Feature itemTypeListInput + { + get + { + return new Feature( + new List() { "-rt", "--item-type" }, + "Filter by item type", + FeatureType.List, + null); + } + } + private static Feature md5ListInput { get { @@ -1377,7 +1399,7 @@ namespace SabreTools null); } } - private static Feature notCrcFeature + private static Feature notCrcListInput { get { @@ -1388,23 +1410,23 @@ namespace SabreTools null); } } - private static Feature notGameFeature + private static Feature notGameNameListInput { get { return new Feature( - new List() { "-ngn", "--not-game" }, + new List() { "-ngn", "--not-game-name" }, "Filter by not game name", FeatureType.List, null); } } - private static Feature notGtypeFeature + private static Feature notGameTypeListInput { get { return new Feature( - new List() { "-ngt", "--not-gtype" }, + new List() { "-ngt", "--not-game-type" }, "Exclude only games with a given type", FeatureType.List, new List() @@ -1414,7 +1436,29 @@ namespace SabreTools }); } } - private static Feature notMd5Feature + private static Feature notItemNameListInput + { + get + { + return new Feature( + new List() { "-nrn", "--not-item-name" }, + "Filter by not rom name", + FeatureType.List, + null); + } + } + private static Feature notItemTypeListInput + { + get + { + return new Feature( + new List() { "-nrt", "--not-item-type" }, + "Filter by not item type", + FeatureType.List, + null); + } + } + private static Feature notMd5ListInput { get { @@ -1425,18 +1469,7 @@ namespace SabreTools null); } } - private static Feature notRomFeature - { - get - { - return new Feature( - new List() { "-nrn", "--not-rom" }, - "Filter by not rom name", - FeatureType.List, - null); - } - } - private static Feature notSha1Feature + private static Feature notSha1ListInput { get { @@ -1447,7 +1480,7 @@ namespace SabreTools null); } } - private static Feature notSha256Feature + private static Feature notSha256ListInput { get { @@ -1458,7 +1491,7 @@ namespace SabreTools null); } } - private static Feature notSha384Feature + private static Feature notSha384ListInput { get { @@ -1469,7 +1502,7 @@ namespace SabreTools null); } } - private static Feature notSha512Feature + private static Feature notSha512ListInput { get { @@ -1480,7 +1513,7 @@ namespace SabreTools null); } } - private static Feature notStatusFeature + private static Feature notStatusListInput { get { @@ -1495,40 +1528,7 @@ namespace SabreTools }); } } - private static Feature notTypeFeature - { - get - { - return new Feature( - new List() { "-nrt", "--not-type" }, - "Filter by not rom type", - FeatureType.List, - null); - } - } - private static Feature romNameFeature - { - get - { - return new Feature( - new List() { "-rn", "--rom-name" }, - "Filter by rom name", - FeatureType.List, - null); - } - } - private static Feature romTypeFeature - { - get - { - return new Feature( - new List() { "-rt", "--rom-type" }, - "Filter by rom type", - FeatureType.List, - null); - } - } - private static Feature sha1Feature + private static Feature sha1ListInput { get { @@ -1539,7 +1539,7 @@ namespace SabreTools null); } } - private static Feature sha256Feature + private static Feature sha256ListInput { get { @@ -1550,7 +1550,7 @@ namespace SabreTools null); } } - private static Feature sha384Feature + private static Feature sha384ListInput { get { @@ -1561,7 +1561,7 @@ namespace SabreTools null); } } - private static Feature sha512Feature + private static Feature sha512ListInput { get { @@ -1572,7 +1572,7 @@ namespace SabreTools null); } } - private static Feature statusFeature + private static Feature statusListInput { get { @@ -1592,18 +1592,18 @@ namespace SabreTools #region Private String features - private static Feature addExtFeature + private static Feature addExtensionStringInput { get { return new Feature( - new List() { "-ae", "--add-ext" }, + new List() { "-ae", "--add-extension" }, "Add an extension to each item", FeatureType.String, null); } } - private static Feature authorFeature + private static Feature authorStringInput { get { @@ -1614,18 +1614,18 @@ namespace SabreTools null); } } - private static Feature categoryFeature + private static Feature categoryStringInput { get { return new Feature( - new List() { "-c", "--cat", "--category" }, + new List() { "-c", "--category" }, "Set the category of the DAT", FeatureType.String, null); } } - private static Feature commentFeature + private static Feature commentStringInput { get { @@ -1636,7 +1636,7 @@ namespace SabreTools null); } } - private static Feature dateFeature + private static Feature dateStringInput { get { @@ -1647,18 +1647,18 @@ namespace SabreTools null); } } - private static Feature descriptionFeature + private static Feature descriptionStringInput { get { return new Feature( - new List() { "-de", "--desc", "--description" }, + new List() { "-de", "--description" }, "Set the description of the DAT", FeatureType.String, null); } } - private static Feature emailFeature + private static Feature emailStringInput { get { @@ -1669,7 +1669,7 @@ namespace SabreTools null); } } - private static Feature equalFeature + private static Feature equalStringInput { get { @@ -1680,7 +1680,7 @@ namespace SabreTools null); } } - private static Feature filenameFeature + private static Feature filenameStringInput { get { @@ -1691,12 +1691,12 @@ namespace SabreTools null); } } - private static Feature forcemergeFeature + private static Feature forcemergingStringInput { get { return new Feature( - new List() { "-fm", "--forcemerge" }, + new List() { "-fm", "--forcemerging" }, "Set force merging", FeatureType.String, new List() @@ -1706,12 +1706,12 @@ namespace SabreTools }); } } - private static Feature forcendFeature + private static Feature forcenodumpStringInput { get { return new Feature( - new List() { "-fn", "--forcend" }, + new List() { "-fn", "--forcenodump" }, "Set force nodump", FeatureType.String, new List() @@ -1721,12 +1721,12 @@ namespace SabreTools }); } } - private static Feature forcepackFeature + private static Feature forcepackingStringInput { get { return new Feature( - new List() { "-fp", "--forcepack" }, + new List() { "-fp", "--forcepacking" }, "Set force packing", FeatureType.String, new List() @@ -1736,7 +1736,7 @@ namespace SabreTools }); } } - private static Feature greaterFeature + private static Feature greaterStringInput { get { @@ -1747,7 +1747,7 @@ namespace SabreTools null); } } - private static Feature headerFeature + private static Feature headerStringInput { get { @@ -1759,7 +1759,7 @@ namespace SabreTools } } - private static Feature homepageFeature + private static Feature homepageStringInput { get { @@ -1770,7 +1770,7 @@ namespace SabreTools null); } } - private static Feature lessFeature + private static Feature lessStringInput { get { @@ -1781,7 +1781,7 @@ namespace SabreTools null); } } - private static Feature nameFeature + private static Feature nameStringInput { get { @@ -1792,29 +1792,18 @@ namespace SabreTools null); } } - private static Feature outFeature + private static Feature outputDirStringInput { get { return new Feature( - new List() { "-out", "--out" }, + new List() { "-out", "--output-dir" }, "Output directory", FeatureType.String, null); } } - private static Feature prefixFeature - { - get - { - return new Feature( - new List() { "-pre", "--prefix" }, - "Set prefix for all lines", - FeatureType.String, - null); - } - } - private static Feature postfixFeature + private static Feature postfixStringInput { get { @@ -1825,17 +1814,39 @@ namespace SabreTools null); } } - private static Feature repExtFeature + private static Feature prefixStringInput { get { return new Feature( - new List() { "-rep", "--rep-ext" }, + new List() { "-pre", "--prefix" }, + "Set prefix for all lines", + FeatureType.String, + null); + } + } + private static Feature replaceExtensionStringInput + { + get + { + return new Feature( + new List() { "-rep", "--replace-extension" }, "Replace all extensions with specified", FeatureType.String, null); } } + private static Feature rootStringInput + { + get + { + return new Feature( + new List() { "-r", "--root" }, + "Set a new rootdir", + FeatureType.String, + null); + } + } private static Feature rootDirFeature { get @@ -1847,17 +1858,6 @@ namespace SabreTools null); } } - private static Feature rootFeature - { - get - { - return new Feature( - new List() { "-r", "--root" }, - "Set a new rootdir", - FeatureType.String, - null); - } - } private static Feature tempFeature { get @@ -1940,7 +1940,7 @@ namespace SabreTools datFromDir.AddFeature("skip-sha384", skipSha384Flag); datFromDir.AddFeature("skip-sha512", skipSha512Flag); datFromDir.AddFeature("no-automatic-date", noAutomaticDateFlag); - datFromDir.AddFeature("forcepack", forcepackFeature); + datFromDir.AddFeature("forcepacking", forcepackingStringInput); datFromDir.AddFeature("archives-as-files", archivesAsFilesFlag); datFromDir.AddFeature("output-all", outputAllFlag); datFromDir.AddFeature("output-attractmode", outputAttractmodeFlag); @@ -1964,27 +1964,27 @@ namespace SabreTools datFromDir.AddFeature("romba", rombaFlag); datFromDir.AddFeature("skip-archives", skipArchivesFlag); datFromDir.AddFeature("skip-files", skipFilesFlag); - datFromDir.AddFeature("filename", filenameFeature); - datFromDir.AddFeature("name", nameFeature); - datFromDir.AddFeature("desc", descriptionFeature); - datFromDir.AddFeature("category", categoryFeature); + datFromDir.AddFeature("filename", filenameStringInput); + datFromDir.AddFeature("name", nameStringInput); + datFromDir.AddFeature("description", descriptionStringInput); + datFromDir.AddFeature("category", categoryStringInput); datFromDir.AddFeature("version", versionFeature); - datFromDir.AddFeature("author", authorFeature); - datFromDir.AddFeature("email", emailFeature); - datFromDir.AddFeature("homepage", homepageFeature); + datFromDir.AddFeature("author", authorStringInput); + datFromDir.AddFeature("email", emailStringInput); + datFromDir.AddFeature("homepage", homepageStringInput); datFromDir.AddFeature("url", urlFeature); - datFromDir.AddFeature("comment", commentFeature); + datFromDir.AddFeature("comment", commentStringInput); datFromDir.AddFeature("superdat", superdatFlag); datFromDir.AddFeature("exclude-of", excludeOfFlag); datFromDir.AddFeature("scene-date-strip", sceneDateStripFlag); datFromDir.AddFeature("add-blank-files", addBlankFilesFlag); datFromDir.AddFeature("add-date", addDateFlag); datFromDir.AddFeature("copy-files", copyFilesFlag); - datFromDir.AddFeature("header", headerFeature); + datFromDir.AddFeature("header", headerStringInput); datFromDir.AddFeature("chds-as-files", chdsAsFilesFlag); datFromDir.AddFeature("temp", tempFeature); - datFromDir.AddFeature("out", outFeature); - datFromDir.AddFeature("mt", mtFeature); + datFromDir.AddFeature("output-dir", outputDirStringInput); + datFromDir.AddFeature("threads", threadsInt32Input); #endregion @@ -1995,7 +1995,7 @@ namespace SabreTools "Extract and remove copier headers", FeatureType.Flag, null); - extract.AddFeature("out", outFeature); + extract.AddFeature("output-dir", outputDirStringInput); extract.AddFeature("no-store-header", noStoreHeaderFlag); #endregion @@ -2007,7 +2007,7 @@ namespace SabreTools "Restore header to file based on SHA-1", FeatureType.Flag, null); - restore.AddFeature("out", outFeature); + restore.AddFeature("output-dir", outputDirStringInput); #endregion @@ -2025,8 +2025,8 @@ namespace SabreTools " 1 Only hash contents", " 2 Only hash archive", }); - sort.AddFeature("dat", datFeature); - sort.AddFeature("out", outFeature); + sort.AddFeature("dat", datListInput); + sort.AddFeature("output-dir", outputDirStringInput); sort.AddFeature("depot", depotFlag); sort.AddFeature("delete", deleteFlag); sort.AddFeature("inverse", inverseFlag); @@ -2044,11 +2044,11 @@ namespace SabreTools sort.AddFeature("torrent-zip", torrentZipFlag); //sort.AddFeature("torrent-zpaq", tzpaqFeature); //sort.AddFeature("torrent-zstd", tzstdFeature); - sort.AddFeature("header", headerFeature); - sort.AddFeature("7z", sevenZipFeature); - sort.AddFeature("gz", gzFeature); - sort.AddFeature("rar", rarFeature); - sort.AddFeature("zip", zipFeature); + sort.AddFeature("header", headerStringInput); + sort.AddFeature("7z", sevenZipInt32Input); + sort.AddFeature("gz", gzInt32Input); + sort.AddFeature("rar", rarInt32Input); + sort.AddFeature("zip", zipInt32Input); sort.AddFeature("scan-all", scanAllFlag); sort.AddFeature("dat-merged", datMergedFlag); sort.AddFeature("dat-split", datSplitFlag); @@ -2056,7 +2056,7 @@ namespace SabreTools sort.AddFeature("dat-device-non-merged", datDeviceNonMergedFlag); sort.AddFeature("dat-full-non-merged", datFullNonMergedFlag); sort.AddFeature("update-dat", updateDatFlag); - sort.AddFeature("mt", mtFeature); + sort.AddFeature("threads", threadsInt32Input); #endregion @@ -2086,11 +2086,11 @@ namespace SabreTools split.AddFeature("output-softwarelist", outputSoftwarelistFlag); split.AddFeature("output-tsv", outputTsvFlag); split.AddFeature("output-xml", outputXmlFlag); - split.AddFeature("out", outFeature); + split.AddFeature("output-dir", outputDirStringInput); split.AddFeature("inplace", inplaceFlag); split.AddFeature("extension", extensionFlag); - split["ext"].AddFeature("exta", extaFeature); - split["ext"].AddFeature("extb", extbFeature); + split["ext"].AddFeature("exta", extaListInput); + split["ext"].AddFeature("extb", extbListInput); split.AddFeature("hash", hashFlag); split.AddFeature("level", levelFlag); split["level"].AddFeature("short", shortFlag); @@ -2109,8 +2109,8 @@ namespace SabreTools stats.AddFeature("all-stats", allStatsFlag); stats.AddFeature("baddump-column", baddumpColumnFlag); stats.AddFeature("csv", csvFlag); - stats.AddFeature("filename", filenameFeature); - stats.AddFeature("out", outFeature); + stats.AddFeature("filename", filenameStringInput); + stats.AddFeature("output-dir", outputDirStringInput); stats.AddFeature("html", htmlFlag); stats.AddFeature("nodump-col", nodumpColumnFlag); stats.AddFeature("individual", individualFlag); @@ -2143,19 +2143,19 @@ namespace SabreTools update.AddFeature("output-attractmode", outputAttractmodeFlag); update.AddFeature("output-cmp", outputCmpFlag); update.AddFeature("output-csv", outputCsvFlag); - update["output-csv"].AddFeature("prefix", prefixFeature); - update["output-csv"].AddFeature("postfix", postfixFeature); + update["output-csv"].AddFeature("prefix", prefixStringInput); + update["output-csv"].AddFeature("postfix", postfixStringInput); update["output-csv"].AddFeature("quotes", quotesFlag); update.AddFeature("output-doscenter", outputDoscenterFlag); update.AddFeature("output-listrom", outputListromFlag); update.AddFeature("output-miss", outputMissFlag); update["output-miss"].AddFeature("roms", romsFlag); update["output-miss"].AddFeature("game-prefix", gamePrefixFlag); - update["output-miss"].AddFeature("prefix", prefixFeature); - update["output-miss"].AddFeature("postfix", postfixFeature); + update["output-miss"].AddFeature("prefix", prefixStringInput); + update["output-miss"].AddFeature("postfix", postfixStringInput); update["output-miss"].AddFeature("quotes", quotesFlag); - update["output-miss"].AddFeature("add-ext", addExtFeature); - update["output-miss"].AddFeature("rep-ext", repExtFeature); + update["output-miss"].AddFeature("add-extension", addExtensionStringInput); + update["output-miss"].AddFeature("replace-extension", replaceExtensionStringInput); update["output-miss"].AddFeature("remove-extensions", removeExtensionsFlag); update["output-miss"].AddFeature("romba", rombaFlag); update.AddFeature("output-md5", outputMd5Flag); @@ -2175,27 +2175,27 @@ namespace SabreTools update["output-sha512"].AddFeature("game-prefix", gamePrefixFlag); update.AddFeature("output-softwarelist", outputSoftwarelistFlag); update.AddFeature("output-tsv", outputTsvFlag); - update["output-tsv"].AddFeature("prefix", prefixFeature); - update["output-tsv"].AddFeature("postfix", postfixFeature); + update["output-tsv"].AddFeature("prefix", prefixStringInput); + update["output-tsv"].AddFeature("postfix", postfixStringInput); update["output-tsv"].AddFeature("quotes", quotesFlag); update.AddFeature("output-xml", outputXmlFlag); - update.AddFeature("filename", filenameFeature); - update.AddFeature("name", nameFeature); - update.AddFeature("desc", descriptionFeature); - update.AddFeature("rootdir", rootFeature); - update.AddFeature("category", categoryFeature); + update.AddFeature("filename", filenameStringInput); + update.AddFeature("name", nameStringInput); + update.AddFeature("description", descriptionStringInput); + update.AddFeature("rootdir", rootStringInput); + update.AddFeature("category", categoryStringInput); update.AddFeature("version", versionFeature); - update.AddFeature("date", dateFeature); - update.AddFeature("author", authorFeature); - update.AddFeature("email", emailFeature); - update.AddFeature("homepage", homepageFeature); + update.AddFeature("date", dateStringInput); + update.AddFeature("author", authorStringInput); + update.AddFeature("email", emailStringInput); + update.AddFeature("homepage", homepageStringInput); update.AddFeature("url", urlFeature); - update.AddFeature("comment", commentFeature); - update.AddFeature("header", headerFeature); + update.AddFeature("comment", commentStringInput); + update.AddFeature("header", headerStringInput); update.AddFeature("superdat", superdatFlag); - update.AddFeature("forcemerge", forcemergeFeature); - update.AddFeature("forcend", forcendFeature); - update.AddFeature("forcepack", forcepackFeature); + update.AddFeature("forcemerging", forcemergingStringInput); + update.AddFeature("forcenodump", forcenodumpStringInput); + update.AddFeature("forcepacking", forcepackingStringInput); update.AddFeature("exclude-of", excludeOfFlag); update.AddFeature("scene-date-strip", sceneDateStripFlag); update.AddFeature("clean", cleanFlag); @@ -2220,7 +2220,7 @@ namespace SabreTools update["merge"].AddFeature("no-automatic-date", noAutomaticDateFlag); update.AddFeature("diff", diffFlag); update["diff"].AddFeature("against", againstFlag); - update["diff"]["against"].AddFeature("base-dat", baseDatFeature); + update["diff"]["against"].AddFeature("base-dat", baseDatListInput); update["diff"].AddFeature("no-automatic-date", noAutomaticDateFlag); update["diff"].AddFeature("cascade", cascadeFlag); update["diff"]["cascade"].AddFeature("skip-first-output", skipFirstOutputFlag); @@ -2233,50 +2233,50 @@ namespace SabreTools update.AddFeature("diff-nd", diffNdFlag); update["diff-nd"].AddFeature("no-automatic-date", noAutomaticDateFlag); update.AddFeature("base-replace", baseReplaceFlag); - update["base-replace"].AddFeature("base-dat", baseDatFeature); + update["base-replace"].AddFeature("base-dat", baseDatListInput); update["base-replace"].AddFeature("update-names", updateNamesFlag); update["base-replace"].AddFeature("update-hashes", updateHashesFlag); update["base-replace"].AddFeature("update-description", updateDescriptionFlag); update["base-replace"].AddFeature("update-year", updateYearFlag); update["base-replace"].AddFeature("update-manufacturer", updateManufacturerFlag); update.AddFeature("reverse-base-replace", reverseBaseReplaceFlag); - update["reverse-base-replace"].AddFeature("base-dat", baseDatFeature); + update["reverse-base-replace"].AddFeature("base-dat", baseDatListInput); update["reverse-base-replace"].AddFeature("update-names", updateNamesFlag); update["reverse-base-replace"].AddFeature("update-hashes", updateHashesFlag); update["reverse-base-replace"].AddFeature("update-description", updateDescriptionFlag); update["reverse-base-replace"].AddFeature("update-year", updateYearFlag); update["reverse-base-replace"].AddFeature("update-manufacturer", updateManufacturerFlag); - update.AddFeature("game-name", gameNameFeature); - update.AddFeature("not-game", notGameFeature); + update.AddFeature("game-name", gameNameListInput); + update.AddFeature("not-game-name", notGameNameListInput); update.AddFeature("match-of-tags", matchOfTagsFlag); - update.AddFeature("rom-name", romNameFeature); - update.AddFeature("not-rom", notRomFeature); - update.AddFeature("rom-type", romTypeFeature); - update.AddFeature("not-type", notTypeFeature); - update.AddFeature("greater", greaterFeature); - update.AddFeature("less", lessFeature); - update.AddFeature("equal", equalFeature); - update.AddFeature("crc", crcFeature); - update.AddFeature("not-crc", notCrcFeature); - update.AddFeature("md5", md5Feature); - update.AddFeature("not-md5", notMd5Feature); - update.AddFeature("sha1", sha1Feature); - update.AddFeature("not-sha1", notSha1Feature); - update.AddFeature("sha256", sha256Feature); - update.AddFeature("not-sha256", notSha256Feature); - update.AddFeature("sha384", sha384Feature); - update.AddFeature("not-sha384", notSha384Feature); - update.AddFeature("sha512", sha512Feature); - update.AddFeature("not-sha512", notSha512Feature); - update.AddFeature("status", statusFeature); - update.AddFeature("not-status", notStatusFeature); - update.AddFeature("game-type", gameTypeFeature); - update.AddFeature("not-gtype", notGtypeFeature); + update.AddFeature("rom-name", itemNameListInput); + update.AddFeature("not-rom-name", notItemNameListInput); + update.AddFeature("rom-type", itemTypeListInput); + update.AddFeature("not-type", notItemTypeListInput); + update.AddFeature("greater", greaterStringInput); + update.AddFeature("less", lessStringInput); + update.AddFeature("equal", equalStringInput); + update.AddFeature("crc", crcListInput); + update.AddFeature("not-crc", notCrcListInput); + update.AddFeature("md5", md5ListInput); + update.AddFeature("not-md5", notMd5ListInput); + update.AddFeature("sha1", sha1ListInput); + update.AddFeature("not-sha1", notSha1ListInput); + update.AddFeature("sha256", sha256ListInput); + update.AddFeature("not-sha256", notSha256ListInput); + update.AddFeature("sha384", sha384ListInput); + update.AddFeature("not-sha384", notSha384ListInput); + update.AddFeature("sha512", sha512ListInput); + update.AddFeature("not-sha512", notSha512ListInput); + update.AddFeature("status", statusListInput); + update.AddFeature("not-status", notStatusListInput); + update.AddFeature("game-type", gameTypeListInput); + update.AddFeature("not-game-type", notGameTypeListInput); update.AddFeature("runnable", runnableFlag); update.AddFeature("not-runnable", notRunnableFlag); - update.AddFeature("out", outFeature); + update.AddFeature("output-dir", outputDirStringInput); update.AddFeature("inplace", inplaceFlag); - update.AddFeature("mt", mtFeature); + update.AddFeature("threads", threadsInt32Input); #endregion @@ -2287,12 +2287,12 @@ namespace SabreTools "Verify a folder against DATs", FeatureType.Flag, null); - verify.AddFeature("dat", datFeature); + verify.AddFeature("dat", datListInput); verify.AddFeature("depot", depotFlag); verify.AddFeature("temp", tempFeature); verify.AddFeature("hash-only", hashOnlyFlag); verify.AddFeature("quick", quickFlag); - verify.AddFeature("header", headerFeature); + verify.AddFeature("header", headerStringInput); verify.AddFeature("chds-as-files", chdsAsFilesFlag); verify.AddFeature("dat-merged", datMergedFlag); verify.AddFeature("dat-split", datSplitFlag); diff --git a/SabreTools/SabreTools.cs b/SabreTools/SabreTools.cs index d61c779f..9ffc6a82 100644 --- a/SabreTools/SabreTools.cs +++ b/SabreTools/SabreTools.cs @@ -179,7 +179,8 @@ namespace SabreTools // Check all of the flag names and translate to arguments switch (feat.Key) { - // User flags + #region User Flags + case "add-blank-files": addBlankFiles = true; break; @@ -511,63 +512,55 @@ namespace SabreTools replaceMode |= ReplaceMode.Year; break; - // User inputs + #endregion + + #region User Int32 Inputs + case "7z": sevenzip = (int)feat.Value.GetValue() == Int32.MinValue ? (int)feat.Value.GetValue() : 1; break; - case "add-ext": - datHeader.AddExtension = (string)feat.Value.GetValue(); + case "gz": + gz = (int)feat.Value.GetValue() == Int32.MinValue ? (int)feat.Value.GetValue() : 1; break; - case "author": - datHeader.Author = (string)feat.Value.GetValue(); + case "rar": + rar = (int)feat.Value.GetValue() == Int32.MinValue ? (int)feat.Value.GetValue() : 1; break; + case "threads": + int val = (int)feat.Value.GetValue(); + if (val != Int32.MinValue) + { + Globals.MaxThreads = val; + } + break; + case "zip": + zip = (int)feat.Value.GetValue() == Int32.MinValue ? (int)feat.Value.GetValue() : 1; + break; + + #endregion + + #region User Int64 Inputs + + #endregion + + #region User List Inputs + case "base-dat": basePaths.AddRange((List)feat.Value.GetValue()); break; - case "category": - datHeader.Category = (string)feat.Value.GetValue(); - break; - case "comment": - datHeader.Comment = (string)feat.Value.GetValue(); - break; case "crc": filter.CRCs.AddRange((List)feat.Value.GetValue()); break; case "dat": datfiles.AddRange((List)feat.Value.GetValue()); break; - case "date": - datHeader.Date = (string)feat.Value.GetValue(); - break; - case "desc": - datHeader.Description = (string)feat.Value.GetValue(); - break; - case "email": - datHeader.Email = (string)feat.Value.GetValue(); - break; - case "equal": - filter.SizeEqualTo = Utilities.GetSizeFromString((string)feat.Value.GetValue()); - break; case "exta": exta.AddRange((List)feat.Value.GetValue()); break; case "extb": extb.AddRange((List)feat.Value.GetValue()); break; - case "filename": - datHeader.FileName = (string)feat.Value.GetValue(); - break; - case "forcemerge": - datHeader.ForceMerging = Utilities.GetForceMerging((string)feat.Value.GetValue()); - break; - case "forcend": - datHeader.ForceNodump = Utilities.GetForceNodump((string)feat.Value.GetValue()); - break; - case "forcepack": - datHeader.ForcePacking = Utilities.GetForcePacking((string)feat.Value.GetValue()); - break; case "game-name": - filter.GameNames.AddRange((List)feat.Value.GetValue()); + filter.MachineNames.AddRange((List)feat.Value.GetValue()); break; case "game-type": foreach (string mach in (List)feat.Value.GetValue()) @@ -575,61 +568,36 @@ namespace SabreTools filter.MachineTypes |= Utilities.GetMachineType(mach); } break; - case "greater": - filter.SizeGreaterThanOrEqual = Utilities.GetSizeFromString((string)feat.Value.GetValue()); + case "item-name": + filter.ItemNames.AddRange((List)feat.Value.GetValue()); break; - case "gz": - gz = (int)feat.Value.GetValue() == Int32.MinValue ? (int)feat.Value.GetValue() : 1; - break; - case "header": - datHeader.Header = (string)feat.Value.GetValue(); - break; - case "homepage": - datHeader.Homepage = (string)feat.Value.GetValue(); - break; - case "less": - filter.SizeLessThanOrEqual = Utilities.GetSizeFromString((string)feat.Value.GetValue()); + case "item-type": + filter.ItemTypes.AddRange((List)feat.Value.GetValue()); break; case "md5": filter.MD5s.AddRange((List)feat.Value.GetValue()); break; - case "mt": - int val = (int)feat.Value.GetValue(); - if (val != Int32.MinValue) - { - Globals.MaxThreads = val; - } - break; - case "name": - datHeader.Name = (string)feat.Value.GetValue(); - break; case "not-crc": filter.NotCRCs.AddRange((List)feat.Value.GetValue()); break; - case "not-game": - filter.NotGameNames.AddRange((List)feat.Value.GetValue()); + case "not-game-name": + filter.NotMachineNames.AddRange((List)feat.Value.GetValue()); break; - case "not-gtype": + case "not-game-type": foreach (string nmach in (List)feat.Value.GetValue()) { filter.NotMachineTypes |= Utilities.GetMachineType(nmach); } break; - case "not-status": - foreach (string nstat in (List)feat.Value.GetValue()) - { - filter.NotItemStatuses |= Utilities.GetItemStatus(nstat); - } + case "not-item-name": + filter.NotItemNames.AddRange((List)feat.Value.GetValue()); + break; + case "not-item-type": + filter.NotItemTypes.AddRange((List)feat.Value.GetValue()); break; case "not-md5": filter.NotMD5s.AddRange((List)feat.Value.GetValue()); break; - case "not-rom": - filter.NotRomNames.AddRange((List)feat.Value.GetValue()); - break; - case "not-type": - filter.NotRomTypes.AddRange((List)feat.Value.GetValue()); - break; case "not-sha1": filter.NotSHA1s.AddRange((List)feat.Value.GetValue()); break; @@ -642,32 +610,11 @@ namespace SabreTools case "not-sha512": filter.NotSHA512s.AddRange((List)feat.Value.GetValue()); break; - case "out": - outDir = (string)feat.Value.GetValue(); - break; - case "postfix": - datHeader.Postfix = (string)feat.Value.GetValue(); - break; - case "prefix": - datHeader.Prefix = (string)feat.Value.GetValue(); - break; - case "rar": - rar = (int)feat.Value.GetValue() == Int32.MinValue ? (int)feat.Value.GetValue() : 1; - break; - case "rep-ext": - datHeader.ReplaceExtension = (string)feat.Value.GetValue(); - break; - case "root": - datHeader.RootDir = (string)feat.Value.GetValue(); - break; - case "rom-name": - filter.RomNames.AddRange((List)feat.Value.GetValue()); - break; - case "rom-type": - filter.RomTypes.AddRange((List)feat.Value.GetValue()); - break; - case "root-dir": - filter.Root = (string)feat.Value.GetValue(); + case "not-status": + foreach (string nstat in (List)feat.Value.GetValue()) + { + filter.NotItemStatuses |= Utilities.GetItemStatus(nstat); + } break; case "sha1": filter.SHA1s.AddRange((List)feat.Value.GetValue()); @@ -687,6 +634,80 @@ namespace SabreTools filter.ItemStatuses |= Utilities.GetItemStatus(stat); } break; + + #endregion + + #region User String Inputs + + case "add-extension": + datHeader.AddExtension = (string)feat.Value.GetValue(); + break; + case "author": + datHeader.Author = (string)feat.Value.GetValue(); + break; + case "category": + datHeader.Category = (string)feat.Value.GetValue(); + break; + case "comment": + datHeader.Comment = (string)feat.Value.GetValue(); + break; + case "date": + datHeader.Date = (string)feat.Value.GetValue(); + break; + case "description": + datHeader.Description = (string)feat.Value.GetValue(); + break; + case "email": + datHeader.Email = (string)feat.Value.GetValue(); + break; + case "equal": + filter.SizeEqualTo = Utilities.GetSizeFromString((string)feat.Value.GetValue()); + break; + case "filename": + datHeader.FileName = (string)feat.Value.GetValue(); + break; + case "forcemerging": + datHeader.ForceMerging = Utilities.GetForceMerging((string)feat.Value.GetValue()); + break; + case "forcenodump": + datHeader.ForceNodump = Utilities.GetForceNodump((string)feat.Value.GetValue()); + break; + case "forcepacking": + datHeader.ForcePacking = Utilities.GetForcePacking((string)feat.Value.GetValue()); + break; + case "greater": + filter.SizeGreaterThanOrEqual = Utilities.GetSizeFromString((string)feat.Value.GetValue()); + break; + case "header": + datHeader.Header = (string)feat.Value.GetValue(); + break; + case "homepage": + datHeader.Homepage = (string)feat.Value.GetValue(); + break; + case "less": + filter.SizeLessThanOrEqual = Utilities.GetSizeFromString((string)feat.Value.GetValue()); + break; + case "name": + datHeader.Name = (string)feat.Value.GetValue(); + break; + case "output-dir": + outDir = (string)feat.Value.GetValue(); + break; + case "postfix": + datHeader.Postfix = (string)feat.Value.GetValue(); + break; + case "prefix": + datHeader.Prefix = (string)feat.Value.GetValue(); + break; + case "replace-extension": + datHeader.ReplaceExtension = (string)feat.Value.GetValue(); + break; + case "root": + datHeader.RootDir = (string)feat.Value.GetValue(); + break; + case "root-dir": + filter.Root = (string)feat.Value.GetValue(); + break; case "temp": tempDir = (string)feat.Value.GetValue(); break; @@ -696,9 +717,8 @@ namespace SabreTools case "version": datHeader.Version = (string)feat.Value.GetValue(); break; - case "zip": - zip = (int)feat.Value.GetValue() == Int32.MinValue ? (int)feat.Value.GetValue() : 1; - break; + + #endregion } }