[MergeDiff] Add "clean" as a parameter

This commit is contained in:
Matt Nadareski
2016-05-29 14:04:06 -07:00
parent c8f962e2bb
commit 922b4287e8
3 changed files with 14 additions and 5 deletions

View File

@@ -521,7 +521,7 @@ namespace SabreTools
// Merge, diff, and dedupe at least 2 DATs
else if (merge || diff)
{
InitMergeDiff(inputs, name, desc, cat, version, author, diff, dedup, bare, forceunpack, old, superdat, cascade, inplace, outdir);
InitMergeDiff(inputs, name, desc, cat, version, author, diff, dedup, bare, forceunpack, old, superdat, cascade, inplace, outdir, clean);
}
// Split a DAT by available hashes
@@ -1380,6 +1380,8 @@ Make a selection:
/// </summary>
/// <param name="filename"></param>
/// <param name="outputFormat"></param>
/// <param name="outdir">Optional param for output directory</param>
/// <param name="clean">True to clean the game names to WoD standard, false otherwise (default)</param>
private static void InitConvert(string filename, OutputFormat outputFormat, string outdir = "", bool clean = false)
{
// Clean the input strings
@@ -1545,8 +1547,10 @@ Make a selection:
/// <param name="superdat">True if DATs should be merged in SuperDAT style, false otherwise</param>
/// <param name="cascade">True if the outputted diffs should be cascaded, false otherwise</param>
/// <param name="inplace">True if cascaded diffs overwrite the source files, false otherwise</param>
/// <param name="outdir">Output directory for the files (blank is default)</param>
/// <param name="clean">True to clean the game names to WoD standard, false otherwise (default)</param>
private static void InitMergeDiff(List<string> inputs, string name, string desc, string cat, string version, string author,
bool diff, bool dedup, bool bare, bool forceunpack, bool old, bool superdat, bool cascade, bool inplace, string outdir = "")
bool diff, bool dedup, bool bare, bool forceunpack, bool old, bool superdat, bool cascade, bool inplace, string outdir = "", bool clean = false)
{
// Make sure there are no folders in inputs
List<string> newInputs = new List<string>();
@@ -1579,7 +1583,7 @@ Make a selection:
}
}
MergeDiff md = new MergeDiff(newInputs, name, desc, cat, version, author, diff, dedup, bare, forceunpack, old, superdat, cascade, inplace, outdir, _logger);
MergeDiff md = new MergeDiff(newInputs, name, desc, cat, version, author, diff, dedup, bare, forceunpack, old, superdat, cascade, inplace, outdir, clean _logger);
md.Process();
}

View File

@@ -21,6 +21,7 @@ namespace SabreTools
private bool _superdat;
private bool _cascade;
private bool _inplace;
private bool _clean;
// User specified strings
private string _name;
@@ -53,9 +54,11 @@ namespace SabreTools
/// <param name="cascade">True if the outputted diffs should be cascaded, false otherwise</param>
/// <param name="inplace">True if cascaded diffs overwrite the source files, false otherwise</param>
/// <param name="outdir">New output directory for outputted DATs (blank means default)</param>
/// <param name="clean">True to clean the game names to WoD standard, false otherwise (default)</param>
/// <param name="logger">Logger object for console and file output</param>
public MergeDiff(List<String> inputs, string name, string desc, string cat, string version, string author,
bool diff, bool dedup, bool bare, bool forceunpack, bool old, bool superdat, bool cascade, bool inplace, string outdir, Logger logger)
bool diff, bool dedup, bool bare, bool forceunpack, bool old, bool superdat, bool cascade, bool inplace,
string outdir, bool clean, Logger logger)
{
_inputs = inputs;
_name = name;
@@ -72,6 +75,7 @@ namespace SabreTools
_cascade = cascade;
_inplace = inplace;
_outdir = outdir.Replace("\"", "");
_clean = clean;
_logger = logger;
}
@@ -123,7 +127,7 @@ namespace SabreTools
foreach (string input in _inputs)
{
_logger.User("Adding DAT: " + input.Split('¬')[0]);
userData = RomManipulation.Parse(input.Split('¬')[0], i, 0, userData, _logger);
userData = RomManipulation.Parse(input.Split('¬')[0], i, 0, userData, _logger, clean:_clean);
i++;
// If we are in inplace mode or redirecting output, save the DAT data

View File

@@ -124,6 +124,7 @@ Options:
-b, --bare Don't include date in file name
-u, --unzip Force unzipping in created DAT
-o, --old Output DAT in CMP format instead of XML
-clean Clean game names according to WoD standards
-out= Output directory (overridden by --inplace)
-sd, --superdat Enable SuperDAT creation
-n=, --name= Set the internal name of the DAT