From e52b9f19a143dd1024c016bfb79d37f8b032d3ac Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Fri, 7 Apr 2017 13:40:50 -0700 Subject: [PATCH] [SabreTools] Enable rest of header flags for DFD --- SabreTools.Helper/README.1ST | 12 ++++++++++++ SabreTools/Partials/SabreTools.Help.cs | 20 ++++++++++++++++++++ SabreTools/Partials/SabreTools.Inits.cs | 20 ++++++++++++++++++++ SabreTools/SabreTools.cs | 6 +++--- 4 files changed, 55 insertions(+), 3 deletions(-) diff --git a/SabreTools.Helper/README.1ST b/SabreTools.Helper/README.1ST index 703ed182..432412d0 100644 --- a/SabreTools.Helper/README.1ST +++ b/SabreTools.Helper/README.1ST @@ -266,6 +266,18 @@ Options: -au=, --author= Set the author of the DAT Set the author for the output DAT(s) [default is blank] + -em=, --email= Set a new email + Set the email for the output DAT(s) [default is blank] + + -hp=, --homepage= Set a new homepage + Set the homepage for the output DAT(s) [default is blank] + + -u=, --url= Set a new URL + Set the URL for the output DAT(s) [default is blank] + + -co=, --comment= Set a new comment + Set the comment for the output DAT(s) [default is blank] + -sd, --superdat Enable SuperDAT creation Set the type flag to "SuperDAT" for the output DAT as well as preserving the directory structure of the inputted folder, if applicable diff --git a/SabreTools/Partials/SabreTools.Help.cs b/SabreTools/Partials/SabreTools.Help.cs index b17ac218..e7b54133 100644 --- a/SabreTools/Partials/SabreTools.Help.cs +++ b/SabreTools/Partials/SabreTools.Help.cs @@ -215,6 +215,26 @@ namespace SabreTools "Set the author of the DAT", FeatureType.String, null)); + datFromDir.AddFeature("email", new Feature( + new List() { "-em", "--email" }, + "Set a new email of the DAT", + FeatureType.String, + null)); + datFromDir.AddFeature("homepage", new Feature( + new List() { "-hp", "--homepage" }, + "Set a new homepage of the DAT", + FeatureType.String, + null)); + datFromDir.AddFeature("url", new Feature( + new List() { "-u", "--url" }, + "Set a new URL of the DAT", + FeatureType.String, + null)); + datFromDir.AddFeature("comment", new Feature( + new List() { "-co", "--comment" }, + "Set a new comment of the DAT", + FeatureType.String, + null)); datFromDir.AddFeature("superdat", new Feature( new List() { "-sd", "--superdat" }, "Enable SuperDAT creation", diff --git a/SabreTools/Partials/SabreTools.Inits.cs b/SabreTools/Partials/SabreTools.Inits.cs index fb3bb722..822ada29 100644 --- a/SabreTools/Partials/SabreTools.Inits.cs +++ b/SabreTools/Partials/SabreTools.Inits.cs @@ -24,15 +24,21 @@ namespace SabreTools /// Wrap creating a DAT file from files or a directory in parallel /// /// List of input filenames + /// /* Normal DAT header info */ /// New filename /// New name /// New description /// New category /// New version /// New author + /// New email + /// New homepage + /// New URL + /// New comment /// String representing the forcepacking flag /// True if cloneof, romof, and sampleof fields should be omitted from output, false otherwise /// DatFormat to be used for outputting the DAT + /// /* Standard DFD info */ /// True to enable reading a directory like a Romba depot, false otherwise /// True to enable SuperDAT-style reading, false otherwise /// Hash flag saying what hashes should not be calculated @@ -41,20 +47,28 @@ namespace SabreTools /// True if GZIP archives should be treated as files, false otherwise /// True if blank items should be created for empty folders, false otherwise /// True if dates should be archived for all files, false otherwise + /// /* Output DAT info */ /// Name of the directory to create a temp folder in (blank is default temp directory) /// Name of the directory to output the DAT to (blank is the current directory) /// True if files should be copied to the temp directory before hashing, false otherwise /// Populated string representing the name of the skipper to use, a blank string to use the first available checker, null otherwise private static void InitDatFromDir(List inputs, + /* Normal DAT header info */ string filename, string name, string description, string category, string version, string author, + string email, + string homepage, + string url, + string comment, string forcepack, bool excludeOf, DatFormat datFormat, + + /* Standard DFD info */ bool romba, bool superdat, Hash omitFromScan, @@ -63,6 +77,8 @@ namespace SabreTools bool enableGzip, bool addBlankFilesForEmptyFolder, bool addFileDates, + + /* Output DAT info */ string tempDir, string outDir, bool copyFiles, @@ -93,6 +109,10 @@ namespace SabreTools Version = version, Date = DateTime.Now.ToString("yyyy-MM-dd"), Author = author, + Email = email, + Homepage = homepage, + Url = url, + Comment = comment, ForcePacking = fp, DatFormat = (datFormat == 0 ? DatFormat.Logiqx : datFormat), Romba = romba, diff --git a/SabreTools/SabreTools.cs b/SabreTools/SabreTools.cs index a26b4fa4..9c0e7195 100644 --- a/SabreTools/SabreTools.cs +++ b/SabreTools/SabreTools.cs @@ -1206,9 +1206,9 @@ namespace SabreTools // Create a DAT from a directory or set of directories if (datFromDir) { - InitDatFromDir(inputs, filename, name, description, category, version, author, forcepack, excludeOf, - datFormat, romba, superdat, omitFromScan, removeDateFromAutomaticName, parseArchivesAsFiles, enableGzip, - addBlankFilesForEmptyFolder, addFileDates, tempDir, outDir, copyFiles, header); + InitDatFromDir(inputs, filename, name, description, category, version, author, email, homepage, url, comment, + forcepack, excludeOf, datFormat, romba, superdat, omitFromScan, removeDateFromAutomaticName, parseArchivesAsFiles, + enableGzip, addBlankFilesForEmptyFolder, addFileDates, tempDir, outDir, copyFiles, header); } // If we're in header extract and remove mode