[SabreTools, DatFile, README.1ST] Add output formats to split

This commit is contained in:
Matt Nadareski
2017-11-08 16:44:27 -08:00
parent 6df461b2e9
commit 54fcf3a1b6
5 changed files with 237 additions and 50 deletions

View File

@@ -4780,8 +4780,10 @@ namespace SabreTools.Library.DatFiles
} }
// Now re-empty the DAT to make room for the next one // Now re-empty the DAT to make room for the next one
DatFormat tempFormat = DatFormat;
_datHeader = new DatHeader(); _datHeader = new DatHeader();
ResetDictionary(); ResetDictionary();
DatFormat = tempFormat;
} }
} }

View File

@@ -416,6 +416,64 @@ Options:
possible criteria. See the individual input information for details. More possible criteria. See the individual input information for details. More
than one split type is allowed at a time. than one split type is allowed at a time.
-oa, --output-all Output in all available formats
Add outputting the created DAT in all available formats. See
specific formats for additional flags that may be used.
-oam, --output-am Output in AttractMode format
Add outputting the created DAT to AttractMode format
-oc, --output-cmp Output in CMP format
Add outputting the created DAT to clrmamepro format
-ocsv, --output-csv Output in Comma-Separated Value format
Add outputting the created DAT to standardized CSV format
-od, --output-dc Output in DOSCenter format
Add outputting the created DAT to DOSCenter format
-olr, --output-lr Output in MAME Listrom format
Add outputting the created DAT to MAME Listrom format
-om, --output-miss Output in Missfile format
Add outputting the created DAT to GoodTools miss format
-omd5, --output-md5 Output in MD5 format
Add outputting the created DAT to MD5 format
-ool, --output-ol Output in OfflineList format
Add outputting the created DAT to OfflineList XML format
-or, --output-rc Output in RomCenter format
Add outputting the created DAT to RomCenter format
-os, --output-sd Output in SabreDAT format
Add outputting the created DAT to SabreDAT XML format
-osfv, --output-sfv Output in SFV format
Add outputting the created DAT to SFV format
-osha1, --output-sha1 Output in SHA-1 format
Add outputting the created DAT to SHA1 format
-osha256, --output-sha256 Output in SHA-256 format
Add outputting the created DAT to SHA-256 format
-osha384, --output-sha384 Output in SHA-384 format
Add outputting the created DAT to SHA-384 format
-osha512, --output-sha512 Output in SHA-512 format
Add outputting the created DAT to SHA-512 format
-osl, --output-sl Output in Software List format
Add outputting the created DAT to Software List XML format
-otsv, --output-tsv Output in Tab-Separated Value format
Add outputting the created DAT to standardized TSV format
-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= Set the name of the output directory
This sets an output folder to be used when the files are created. If 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. a path is not defined, the application directory is used instead.

View File

@@ -21,21 +21,28 @@ namespace SabreTools
}; };
Help help = new Help(helpHeader); Help help = new Help(helpHeader);
// Create the Help feature #region Help
Feature helpFeature = new Feature( Feature helpFeature = new Feature(
new List<string>() { "-?", "-h", "--help" }, new List<string>() { "-?", "-h", "--help" },
"Show this help", "Show this help",
FeatureType.Flag, FeatureType.Flag,
null); null);
// Create the Script feature #endregion
#region Script
Feature script = new Feature( Feature script = new Feature(
"--script", "--script",
"Enable script mode (no clear screen)", "Enable script mode (no clear screen)",
FeatureType.Flag, FeatureType.Flag,
null); null);
// Create the DATFromDir feature #endregion
#region DATFromDir
Feature datFromDir = new Feature( Feature datFromDir = new Feature(
new List<string>() { "-d", "--d2d", "--dfd" }, new List<string>() { "-d", "--d2d", "--dfd" },
"Create DAT(s) from an input directory", "Create DAT(s) from an input directory",
@@ -301,7 +308,10 @@ namespace SabreTools
FeatureType.String, FeatureType.String,
null)); null));
// Create the Extract feature #endregion
#region Extract
Feature extract = new Feature( Feature extract = new Feature(
new List<string>() { "-ex", "--extract" }, new List<string>() { "-ex", "--extract" },
"Extract and remove copier headers", "Extract and remove copier headers",
@@ -318,7 +328,10 @@ namespace SabreTools
FeatureType.Flag, FeatureType.Flag,
null)); null));
// Create the Restore feature #endregion
#region Restore
Feature restore = new Feature( Feature restore = new Feature(
new List<string>() { "-re", "--restore" }, new List<string>() { "-re", "--restore" },
"Restore header to file based on SHA-1", "Restore header to file based on SHA-1",
@@ -330,7 +343,10 @@ namespace SabreTools
FeatureType.String, FeatureType.String,
null)); null));
// Create the Sort feature #endregion
#region Sort
Feature sort = new Feature( Feature sort = new Feature(
new List<string>() { "-ss", "--sort" }, new List<string>() { "-ss", "--sort" },
"Sort inputs by a set of DATs", "Sort inputs by a set of DATs",
@@ -511,12 +527,110 @@ namespace SabreTools
FeatureType.String, FeatureType.String,
null)); null));
// Create the Split feature #endregion
#region Split
Feature split = new Feature( Feature split = new Feature(
new List<string>() { "-sp", "--split" }, new List<string>() { "-sp", "--split" },
"Split input DATs by a given criteria", "Split input DATs by a given criteria",
FeatureType.Flag, FeatureType.Flag,
null); null);
split.AddFeature("output-all", new Feature(
new List<string>() { "-oa", "--output-all" },
"Output in all formats",
FeatureType.Flag,
null));
split.AddFeature("output-am", new Feature(
new List<string>() { "-oam", "--output-am" },
"Output in AttractMode format",
FeatureType.Flag,
null));
split.AddFeature("output-cmp", new Feature(
new List<string>() { "-oc", "--output-cmp" },
"Output in CMP format",
FeatureType.Flag,
null));
split.AddFeature("output-csv", new Feature(
new List<string>() { "-ocsv", "--output-csv" },
"Output in CSV format",
FeatureType.Flag,
null));
split.AddFeature("output-dc", new Feature(
new List<string>() { "-od", "--output-dc" },
"Output in DOSCenter format",
FeatureType.Flag,
null));
split.AddFeature("output-lr", new Feature(
new List<string>() { "-olr", "--output-lr" },
"Output in MAME Listrom format",
FeatureType.Flag,
null));
split.AddFeature("output-miss", new Feature(
new List<string>() { "-om", "--output-miss" },
"Output in Missfile format",
FeatureType.Flag,
null));
split.AddFeature("output-md5", new Feature(
new List<string>() { "-omd5", "--output-md5" },
"Output in MD5 format",
FeatureType.Flag,
null));
split.AddFeature("output-ol", new Feature(
new List<string>() { "-ool", "--output-ol" },
"Output in OfflineList format",
FeatureType.Flag,
null));
split.AddFeature("output-rc", new Feature(
new List<string>() { "-or", "--output-rc" },
"Output in RomCenter format",
FeatureType.Flag,
null));
split.AddFeature("output-sd", new Feature(
new List<string>() { "-os", "--output-sd" },
"Output in SabreDat format",
FeatureType.Flag,
null));
split.AddFeature("output-sfv", new Feature(
new List<string>() { "-osfv", "--output-sfv" },
"Output in SFV format",
FeatureType.Flag,
null));
split.AddFeature("output-sha1", new Feature(
new List<string>() { "-osha1", "--output-sha1" },
"Output in SHA-1 format",
FeatureType.Flag,
null));
split.AddFeature("output-sha256", new Feature(
new List<string>() { "-osha256", "--output-sha256" },
"Output in SHA-256 format",
FeatureType.Flag,
null));
split.AddFeature("output-sha384", new Feature(
new List<string>() { "-osha384", "--output-sha384" },
"Output in SHA-384 format",
FeatureType.Flag,
null));
split.AddFeature("output-sha512", new Feature(
new List<string>() { "-osha512", "--output-sha512" },
"Output in SHA-512 format",
FeatureType.Flag,
null));
split.AddFeature("output-sl", new Feature(
new List<string>() { "-osl", "--output-sl" },
"Output in Softwarelist format",
FeatureType.Flag,
null));
split.AddFeature("output-tsv", new Feature(
new List<string>() { "-otsv", "--output-tsv" },
"Output in TSV format",
FeatureType.Flag,
null));
split.AddFeature("output-xml", new Feature(
new List<string>() { "-ox", "--output-xml" },
"Output in Logiqx XML format",
FeatureType.Flag,
null));
split.AddFeature("out", new Feature( split.AddFeature("out", new Feature(
new List<string>() { "-out", "--out" }, new List<string>() { "-out", "--out" },
"Output directory", "Output directory",
@@ -568,7 +682,10 @@ namespace SabreTools
FeatureType.Flag, FeatureType.Flag,
null)); null));
// Create the Stats feature #endregion
#region Stats
Feature stats = new Feature( Feature stats = new Feature(
new List<string>() { "-st", "--stats" }, new List<string>() { "-st", "--stats" },
"Get statistics on all input DATs", "Get statistics on all input DATs",
@@ -625,7 +742,10 @@ namespace SabreTools
FeatureType.Flag, FeatureType.Flag,
null)); null));
// Create the Update feature #endregion
#region Update
Feature update = new Feature( Feature update = new Feature(
new List<string>() { "-ud", "--update" }, new List<string>() { "-ud", "--update" },
"Update and manipulate DAT file(s)", "Update and manipulate DAT file(s)",
@@ -667,17 +787,17 @@ namespace SabreTools
"Output in CSV format", "Output in CSV format",
FeatureType.Flag, FeatureType.Flag,
null)); null));
update["output-csv"].AddFeature("prefix", new Feature( split["output-csv"].AddFeature("prefix", new Feature(
new List<string>() { "-pre", "--prefix" }, new List<string>() { "-pre", "--prefix" },
"Set prefix for all lines", "Set prefix for all lines",
FeatureType.String, FeatureType.String,
null)); null));
update["output-csv"].AddFeature("postfix", new Feature( split["output-csv"].AddFeature("postfix", new Feature(
new List<string>() { "-post", "--postfix" }, new List<string>() { "-post", "--postfix" },
"Set postfix for all lines", "Set postfix for all lines",
FeatureType.String, FeatureType.String,
null)); null));
update["output-csv"].AddFeature("quotes", new Feature( split["output-csv"].AddFeature("quotes", new Feature(
new List<string>() { "-q", "--quotes" }, new List<string>() { "-q", "--quotes" },
"Put double-quotes around each item", "Put double-quotes around each item",
FeatureType.Flag, FeatureType.Flag,
@@ -704,57 +824,57 @@ namespace SabreTools
"A list of features that can be used are:", "A list of features that can be used are:",
" game, name, crc, md5, sha1, sha256, sha384, sha512, size", " game, name, crc, md5, sha1, sha256, sha384, sha512, size",
})); }));
update["output-miss"].AddFeature("roms", new Feature( split["output-miss"].AddFeature("roms", new Feature(
new List<string>() { "-r", "--roms" }, new List<string>() { "-r", "--roms" },
"Output roms to miss instead of sets", "Output roms to miss instead of sets",
FeatureType.Flag, FeatureType.Flag,
null)); null));
update["output-miss"].AddFeature("game-prefix", new Feature( split["output-miss"].AddFeature("game-prefix", new Feature(
new List<string>() { "-gp", "--game-prefix" }, new List<string>() { "-gp", "--game-prefix" },
"Add game name as a prefix", "Add game name as a prefix",
FeatureType.Flag, FeatureType.Flag,
null)); null));
update["output-miss"].AddFeature("prefix", new Feature( split["output-miss"].AddFeature("prefix", new Feature(
new List<string>() { "-pre", "--prefix" }, new List<string>() { "-pre", "--prefix" },
"Set prefix for all lines", "Set prefix for all lines",
FeatureType.String, FeatureType.String,
null)); null));
update["output-miss"].AddFeature("postfix", new Feature( split["output-miss"].AddFeature("postfix", new Feature(
new List<string>() { "-post", "--postfix" }, new List<string>() { "-post", "--postfix" },
"Set postfix for all lines", "Set postfix for all lines",
FeatureType.String, FeatureType.String,
null)); null));
update["output-miss"].AddFeature("quotes", new Feature( split["output-miss"].AddFeature("quotes", new Feature(
new List<string>() { "-q", "--quotes" }, new List<string>() { "-q", "--quotes" },
"Put double-quotes around each item", "Put double-quotes around each item",
FeatureType.Flag, FeatureType.Flag,
null)); null));
update["output-miss"].AddFeature("add-ext", new Feature( split["output-miss"].AddFeature("add-ext", new Feature(
new List<string>() { "-ae", "--add-ext" }, new List<string>() { "-ae", "--add-ext" },
"Add an extension to each item", "Add an extension to each item",
FeatureType.String, FeatureType.String,
null)); null));
update["output-miss"].AddFeature("rep-ext", new Feature( split["output-miss"].AddFeature("rep-ext", new Feature(
new List<string>() { "-rep", "--rep-ext" }, new List<string>() { "-rep", "--rep-ext" },
"Replace all extensions with specified", "Replace all extensions with specified",
FeatureType.String, FeatureType.String,
null)); null));
update["output-miss"].AddFeature("rem-ext", new Feature( split["output-miss"].AddFeature("rem-ext", new Feature(
new List<string>() { "-rme", "--rem-ext" }, new List<string>() { "-rme", "--rem-ext" },
"Remove all extensions from each item", "Remove all extensions from each item",
FeatureType.String, FeatureType.String,
null)); null));
update["output-miss"].AddFeature("romba", new Feature( split["output-miss"].AddFeature("romba", new Feature(
new List<string>() { "-ro", "--romba" }, new List<string>() { "-ro", "--romba" },
"Output in Romba format (requires SHA-1)", "Output in Romba format (requires SHA-1)",
FeatureType.Flag, FeatureType.Flag,
null)); null));
update["output-miss"].AddFeature("tsv", new Feature( split["output-miss"].AddFeature("tsv", new Feature(
new List<string>() { "-tsv", "--tsv" }, new List<string>() { "-tsv", "--tsv" },
"Output in Tab-Separated Value format", "Output in Tab-Separated Value format",
FeatureType.Flag, FeatureType.Flag,
null)); null));
update["output-miss"].AddFeature("csv", new Feature( split["output-miss"].AddFeature("csv", new Feature(
new List<string>() { "-csv", "--csv" }, new List<string>() { "-csv", "--csv" },
"Output in Comma-Separated Value format", "Output in Comma-Separated Value format",
FeatureType.Flag, FeatureType.Flag,
@@ -764,7 +884,7 @@ namespace SabreTools
"Output in MD5 format", "Output in MD5 format",
FeatureType.Flag, FeatureType.Flag,
null)); null));
update["output-md5"].AddFeature("game-prefix", new Feature( split["output-md5"].AddFeature("game-prefix", new Feature(
new List<string>() { "-gp", "--game-prefix" }, new List<string>() { "-gp", "--game-prefix" },
"Add game name as a prefix", "Add game name as a prefix",
FeatureType.Flag, FeatureType.Flag,
@@ -789,7 +909,7 @@ namespace SabreTools
"Output in SFV format", "Output in SFV format",
FeatureType.Flag, FeatureType.Flag,
null)); null));
update["output-sfv"].AddFeature("game-prefix", new Feature( split["output-sfv"].AddFeature("game-prefix", new Feature(
new List<string>() { "-gp", "--game-prefix" }, new List<string>() { "-gp", "--game-prefix" },
"Add game name as a prefix", "Add game name as a prefix",
FeatureType.Flag, FeatureType.Flag,
@@ -799,7 +919,7 @@ namespace SabreTools
"Output in SHA-1 format", "Output in SHA-1 format",
FeatureType.Flag, FeatureType.Flag,
null)); null));
update["output-sha1"].AddFeature("game-prefix", new Feature( split["output-sha1"].AddFeature("game-prefix", new Feature(
new List<string>() { "-gp", "--game-prefix" }, new List<string>() { "-gp", "--game-prefix" },
"Add game name as a prefix", "Add game name as a prefix",
FeatureType.Flag, FeatureType.Flag,
@@ -809,7 +929,7 @@ namespace SabreTools
"Output in SHA-256 format", "Output in SHA-256 format",
FeatureType.Flag, FeatureType.Flag,
null)); null));
update["output-sha256"].AddFeature("game-prefix", new Feature( split["output-sha256"].AddFeature("game-prefix", new Feature(
new List<string>() { "-gp", "--game-prefix" }, new List<string>() { "-gp", "--game-prefix" },
"Add game name as a prefix", "Add game name as a prefix",
FeatureType.Flag, FeatureType.Flag,
@@ -819,7 +939,7 @@ namespace SabreTools
"Output in SHA-384 format", "Output in SHA-384 format",
FeatureType.Flag, FeatureType.Flag,
null)); null));
update["output-sha384"].AddFeature("game-prefix", new Feature( split["output-sha384"].AddFeature("game-prefix", new Feature(
new List<string>() { "-gp", "--game-prefix" }, new List<string>() { "-gp", "--game-prefix" },
"Add game name as a prefix", "Add game name as a prefix",
FeatureType.Flag, FeatureType.Flag,
@@ -829,7 +949,7 @@ namespace SabreTools
"Output in SHA-512 format", "Output in SHA-512 format",
FeatureType.Flag, FeatureType.Flag,
null)); null));
update["output-sha512"].AddFeature("game-prefix", new Feature( split["output-sha512"].AddFeature("game-prefix", new Feature(
new List<string>() { "-gp", "--game-prefix" }, new List<string>() { "-gp", "--game-prefix" },
"Add game name as a prefix", "Add game name as a prefix",
FeatureType.Flag, FeatureType.Flag,
@@ -844,17 +964,17 @@ namespace SabreTools
"Output in TSV format", "Output in TSV format",
FeatureType.Flag, FeatureType.Flag,
null)); null));
update["output-tsv"].AddFeature("prefix", new Feature( split["output-tsv"].AddFeature("prefix", new Feature(
new List<string>() { "-pre", "--prefix" }, new List<string>() { "-pre", "--prefix" },
"Set prefix for all lines", "Set prefix for all lines",
FeatureType.String, FeatureType.String,
null)); null));
update["output-tsv"].AddFeature("postfix", new Feature( split["output-tsv"].AddFeature("postfix", new Feature(
new List<string>() { "-post", "--postfix" }, new List<string>() { "-post", "--postfix" },
"Set postfix for all lines", "Set postfix for all lines",
FeatureType.String, FeatureType.String,
null)); null));
update["output-tsv"].AddFeature("quotes", new Feature( split["output-tsv"].AddFeature("quotes", new Feature(
new List<string>() { "-q", "--quotes" }, new List<string>() { "-q", "--quotes" },
"Put double-quotes around each item", "Put double-quotes around each item",
FeatureType.Flag, FeatureType.Flag,
@@ -1041,7 +1161,7 @@ namespace SabreTools
"Trim file names to fit NTFS length", "Trim file names to fit NTFS length",
FeatureType.Flag, FeatureType.Flag,
null)); null));
update["trim"].AddFeature("root-dir", new Feature( split["trim"].AddFeature("root-dir", new Feature(
new List<string>() { "-rd", "--root-dir" }, new List<string>() { "-rd", "--root-dir" },
"Set the root directory for calc", "Set the root directory for calc",
FeatureType.String, FeatureType.String,
@@ -1066,7 +1186,7 @@ namespace SabreTools
"Merge the input DATs", "Merge the input DATs",
FeatureType.Flag, FeatureType.Flag,
null)); null));
update["merge"].AddFeature("bare", new Feature( split["merge"].AddFeature("bare", new Feature(
new List<string>() { "-b", "--bare" }, new List<string>() { "-b", "--bare" },
"Don't include the date in automatic name", "Don't include the date in automatic name",
FeatureType.Flag, FeatureType.Flag,
@@ -1076,37 +1196,37 @@ namespace SabreTools
"Create diffdats from inputs (all outputs)", "Create diffdats from inputs (all outputs)",
FeatureType.Flag, FeatureType.Flag,
null)); null));
update["diff"].AddFeature("against", new Feature( split["diff"].AddFeature("against", new Feature(
new List<string>() { "-ag", "--against" }, new List<string>() { "-ag", "--against" },
"Diff all inputs against a set of base DATs", "Diff all inputs against a set of base DATs",
FeatureType.Flag, FeatureType.Flag,
null)); null));
update["diff"]["against"].AddFeature("base-dat", new Feature( split["diff"]["against"].AddFeature("base-dat", new Feature(
new List<string>() { "-bd", "--base-dat" }, new List<string>() { "-bd", "--base-dat" },
"Add a base DAT for diffing", "Add a base DAT for diffing",
FeatureType.List, FeatureType.List,
null)); null));
update["diff"].AddFeature("bare", new Feature( split["diff"].AddFeature("bare", new Feature(
new List<string>() { "-b", "--bare" }, new List<string>() { "-b", "--bare" },
"Don't include the date in automatic name", "Don't include the date in automatic name",
FeatureType.Flag, FeatureType.Flag,
null)); null));
update["diff"].AddFeature("cascade", new Feature( split["diff"].AddFeature("cascade", new Feature(
new List<string>() { "-c", "--cascade" }, new List<string>() { "-c", "--cascade" },
"Enable cascaded diffing", "Enable cascaded diffing",
FeatureType.Flag, FeatureType.Flag,
null)); null));
update["diff"]["cascade"].AddFeature("skip", new Feature( split["diff"]["cascade"].AddFeature("skip", new Feature(
new List<string>() { "-sf", "--skip" }, new List<string>() { "-sf", "--skip" },
"Skip output of first DAT", "Skip output of first DAT",
FeatureType.Flag, FeatureType.Flag,
null)); null));
update["diff"].AddFeature("rev-cascade", new Feature( split["diff"].AddFeature("rev-cascade", new Feature(
new List<string>() { "-rc", "--rev-cascade" }, new List<string>() { "-rc", "--rev-cascade" },
"Enable reverse cascaded diffing", "Enable reverse cascaded diffing",
FeatureType.Flag, FeatureType.Flag,
null)); null));
update["diff"]["rev-cascade"].AddFeature("skip", new Feature( split["diff"]["rev-cascade"].AddFeature("skip", new Feature(
new List<string>() { "-sf", "--skip" }, new List<string>() { "-sf", "--skip" },
"Skip output of first DAT", "Skip output of first DAT",
FeatureType.Flag, FeatureType.Flag,
@@ -1116,7 +1236,7 @@ namespace SabreTools
"Create diffdat containing just duplicates", "Create diffdat containing just duplicates",
FeatureType.Flag, FeatureType.Flag,
null)); null));
update["diff-du"].AddFeature("bare", new Feature( split["diff-du"].AddFeature("bare", new Feature(
new List<string>() { "-b", "--bare" }, new List<string>() { "-b", "--bare" },
"Don't include the date in automatic name", "Don't include the date in automatic name",
FeatureType.Flag, FeatureType.Flag,
@@ -1126,7 +1246,7 @@ namespace SabreTools
"Create diffdats for individual DATs", "Create diffdats for individual DATs",
FeatureType.Flag, FeatureType.Flag,
null)); null));
update["diff-in"].AddFeature("bare", new Feature( split["diff-in"].AddFeature("bare", new Feature(
new List<string>() { "-b", "--bare" }, new List<string>() { "-b", "--bare" },
"Don't include the date in automatic name", "Don't include the date in automatic name",
FeatureType.Flag, FeatureType.Flag,
@@ -1136,7 +1256,7 @@ namespace SabreTools
"Create diffdat containing no duplicates", "Create diffdat containing no duplicates",
FeatureType.Flag, FeatureType.Flag,
null)); null));
update["diff-nd"].AddFeature("bare", new Feature( split["diff-nd"].AddFeature("bare", new Feature(
new List<string>() { "-b", "--bare" }, new List<string>() { "-b", "--bare" },
"Don't include the date in automatic name", "Don't include the date in automatic name",
FeatureType.Flag, FeatureType.Flag,
@@ -1146,7 +1266,7 @@ namespace SabreTools
"Replace item names from base DATs in order", "Replace item names from base DATs in order",
FeatureType.Flag, FeatureType.Flag,
null)); null));
update["base-name"].AddFeature("base-dat", new Feature( split["base-name"].AddFeature("base-dat", new Feature(
new List<string>() { "-bd", "--base-dat" }, new List<string>() { "-bd", "--base-dat" },
"Add a base DAT for replacing", "Add a base DAT for replacing",
FeatureType.List, FeatureType.List,
@@ -1156,7 +1276,7 @@ namespace SabreTools
"Replace item names from base DATs in reverse", "Replace item names from base DATs in reverse",
FeatureType.Flag, FeatureType.Flag,
null)); null));
update["reverse-base-name"].AddFeature("base-dat", new Feature( split["reverse-base-name"].AddFeature("base-dat", new Feature(
new List<string>() { "-bd", "--base-dat" }, new List<string>() { "-bd", "--base-dat" },
"Add a base DAT for replacing", "Add a base DAT for replacing",
FeatureType.List, FeatureType.List,
@@ -1333,7 +1453,10 @@ namespace SabreTools
FeatureType.String, FeatureType.String,
null)); null));
// Create the Verify feature #endregion
#region Verify
Feature verify = new Feature( Feature verify = new Feature(
new List<string>() { "-ve", "--verify" }, new List<string>() { "-ve", "--verify" },
"Verify a folder against DATs", "Verify a folder against DATs",
@@ -1395,6 +1518,8 @@ namespace SabreTools
FeatureType.Flag, FeatureType.Flag,
null)); null));
#endregion
// Now, add all of the main features to the Help object // Now, add all of the main features to the Help object
help.Add("Help", helpFeature); help.Add("Help", helpFeature);
help.Add("Script", script); help.Add("Script", script);

View File

@@ -249,15 +249,17 @@ namespace SabreTools
/// <param name="inputs">List of inputs to be used</param> /// <param name="inputs">List of inputs to be used</param>
/// <param name="outDir">Output directory for the split files</param> /// <param name="outDir">Output directory for the split files</param>
/// <param name="inplace">True if files should be written to the source folders, false otherwise</param> /// <param name="inplace">True if files should be written to the source folders, false otherwise</param>
/// <param name="datFormat">DatFormat to be used for outputting the DAT</param>
/// <param name="splitType">Type of split to perform, if any</param> /// <param name="splitType">Type of split to perform, if any</param>
/// <param name="exta">First extension to split on (Extension Split only)</param> /// <param name="exta">First extension to split on (Extension Split only)</param>
/// <param name="extb">Second extension to split on (Extension Split only)</param> /// <param name="extb">Second extension to split on (Extension Split only)</param>
/// <param name="shortname">True if short filenames should be used, false otherwise (Level Split only)</param> /// <param name="shortname">True if short filenames should be used, false otherwise (Level Split only)</param>
/// <param name="basedat">True if original filenames should be used as the base for output filename, false otherwise (Level Split only)</param> /// <param name="basedat">True if original filenames should be used as the base for output filename, false otherwise (Level Split only)</param>
private static void InitSplit(List<string> inputs, string outDir, bool inplace, ExternalSplitType splitType, private static void InitSplit(List<string> inputs, string outDir, bool inplace, DatFormat datFormat,
List<string> exta, List<string> extb, bool shortname, bool basedat) ExternalSplitType splitType, List<string> exta, List<string> extb, bool shortname, bool basedat)
{ {
DatFile datfile = new DatFile(); DatFile datfile = new DatFile();
datfile.DatFormat = datFormat;
datfile.DetermineSplitType(inputs, outDir, inplace, splitType, exta, extb, shortname, basedat); datfile.DetermineSplitType(inputs, outDir, inplace, splitType, exta, extb, shortname, basedat);
} }

View File

@@ -1302,7 +1302,7 @@ namespace SabreTools
// Split a DAT by the split type // Split a DAT by the split type
else if (split) else if (split)
{ {
InitSplit(inputs, outDir, inplace, externalSplitType, exta, extb, shortname, basedat); InitSplit(inputs, outDir, inplace, datFormat, externalSplitType, exta, extb, shortname, basedat);
} }
// Get statistics on input files // Get statistics on input files