mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
noDate should be bare
This commit is contained in:
@@ -29,7 +29,7 @@ namespace SabreTools
|
||||
// User specified flags
|
||||
private bool _noMD5;
|
||||
private bool _noSHA1;
|
||||
private bool _noDate;
|
||||
private bool _bare;
|
||||
private bool _forceunpack;
|
||||
private bool _archivesAsFiles;
|
||||
private bool _old;
|
||||
@@ -57,14 +57,14 @@ namespace SabreTools
|
||||
/// <param name="author">Author of the DAT</param>
|
||||
/// <param name="noMD5">True if MD5 hashes should be skipped over, false otherwise</param>
|
||||
/// <param name="noSHA1">True if SHA-1 hashes should be skipped over, false otherwise</param>
|
||||
/// <param name="noDate">True if the date should be omitted from the DAT, false otherwise</param>
|
||||
/// <param name="bare">True if the date should be omitted from the DAT, false otherwise</param>
|
||||
/// <param name="forceunpack">True if the forcepacking="unzip" tag is to be added, false otherwise</param>
|
||||
/// <param name="archivesAsFiles">True if all archives should be treated like files, false otherwise</param>
|
||||
/// <param name="old">True if a old-style DAT should be output, false otherwise</param>
|
||||
/// <param name="superDat">True if SuperDAT mode is enabled, false otherwise</param>
|
||||
/// <param name="logger">Logger object for console and file output</param>
|
||||
public DATFromDir(List<String> inputs, string name, string desc, string cat, string version, string author,
|
||||
bool noMD5, bool noSHA1, bool noDate, bool forceunpack, bool archivesAsFiles, bool old, bool superDat, Logger logger)
|
||||
bool noMD5, bool noSHA1, bool bare, bool forceunpack, bool archivesAsFiles, bool old, bool superDat, Logger logger)
|
||||
{
|
||||
_inputs = inputs;
|
||||
_name = name;
|
||||
@@ -74,7 +74,7 @@ namespace SabreTools
|
||||
_author = author;
|
||||
_noMD5 = noMD5;
|
||||
_noSHA1 = noSHA1;
|
||||
_noDate = noDate;
|
||||
_bare = bare;
|
||||
_forceunpack = forceunpack;
|
||||
_archivesAsFiles = archivesAsFiles;
|
||||
_old = old;
|
||||
@@ -101,7 +101,7 @@ namespace SabreTools
|
||||
logger.Start();
|
||||
|
||||
// First things first, take care of all of the arguments that this could have
|
||||
bool noMD5 = false, noSHA1 = false, forceunpack = false, archivesAsFiles = false, old = false, log = false, superDat = false, noDate = false;
|
||||
bool noMD5 = false, noSHA1 = false, forceunpack = false, archivesAsFiles = false, old = false, log = false, superDat = false, bare = false;
|
||||
string name = "", desc = "", cat = "", version = "", author = "";
|
||||
List<string> inputs = new List<string>();
|
||||
foreach (string arg in args)
|
||||
@@ -124,7 +124,7 @@ namespace SabreTools
|
||||
break;
|
||||
case "-b":
|
||||
case "--bare":
|
||||
noDate = true;
|
||||
bare = true;
|
||||
break;
|
||||
case "-u":
|
||||
case "--unzip":
|
||||
@@ -202,7 +202,7 @@ namespace SabreTools
|
||||
}
|
||||
|
||||
// Create a new DATFromDir object and process the inputs
|
||||
DATFromDir dfd = new DATFromDir(inputs, name, desc, cat, version, author, noMD5, noSHA1, noDate, forceunpack, archivesAsFiles, old, superDat, logger);
|
||||
DATFromDir dfd = new DATFromDir(inputs, name, desc, cat, version, author, noMD5, noSHA1, bare, forceunpack, archivesAsFiles, old, superDat, logger);
|
||||
bool success = dfd.Start();
|
||||
|
||||
// If we failed, show the help
|
||||
@@ -309,7 +309,7 @@ namespace SabreTools
|
||||
}
|
||||
}
|
||||
_name = (_name == "" ? "Default" : _name);
|
||||
_desc = (_desc == "" ? _name + (_noDate ? "" : " (" + _date + ")") : _desc);
|
||||
_desc = (_desc == "" ? _name + (_bare ? "" : " (" + _date + ")") : _desc);
|
||||
|
||||
// Now write it all out as a DAT
|
||||
Output.WriteToDat(_name, _desc, _version, _date, _cat, _author, _forceunpack, _old, Environment.CurrentDirectory, _roms, _logger);
|
||||
|
||||
@@ -68,7 +68,6 @@ namespace SabreTools
|
||||
listsrc = false,
|
||||
listsys = false,
|
||||
merge = false,
|
||||
noDate = false,
|
||||
norename = false,
|
||||
old = false,
|
||||
quotes = false,
|
||||
@@ -111,7 +110,7 @@ namespace SabreTools
|
||||
break;
|
||||
case "-b":
|
||||
case "--bare":
|
||||
noDate = true;
|
||||
bare = true;
|
||||
break;
|
||||
case "-cc":
|
||||
case "--convert-cmp":
|
||||
@@ -435,7 +434,7 @@ namespace SabreTools
|
||||
// Merge, diff, and dedupe at least 2 DATs
|
||||
else if (merge)
|
||||
{
|
||||
InitMergeDiff(inputs, name, desc, cat, version, author, diff, dedup, noDate, forceunpack, old);
|
||||
InitMergeDiff(inputs, name, desc, cat, version, author, diff, dedup, bare, forceunpack, old);
|
||||
}
|
||||
|
||||
logger.Close();
|
||||
@@ -854,7 +853,7 @@ Make a selection:
|
||||
private static void MergeDiffMenu()
|
||||
{
|
||||
string selection = "", input = "", name = "", desc = "", cat = "", version = "", author = "";
|
||||
bool dedup = false, diff = false, noDate = false, forceunpack = false, old = false;
|
||||
bool dedup = false, diff = false, bare = false, forceunpack = false, old = false;
|
||||
while (selection.ToLowerInvariant() != "b")
|
||||
{
|
||||
Console.Clear();
|
||||
@@ -871,7 +870,7 @@ Make a selection:
|
||||
6) Author" + (author != "" ? ":\t" + author : "") + @"
|
||||
7) " + (dedup ? "Don't dedup files in output" : "Dedup files in output") + @"
|
||||
8) " + (diff ? "Only merge the input files" : "Diff the input files") + @"
|
||||
9) " + (noDate ? "Don't append the date to the name" : "Append the date to the name") + @"
|
||||
9) " + (bare ? "Don't append the date to the name" : "Append the date to the name") + @"
|
||||
10) " + (forceunpack ? "Remove 'forcepacking=\"unzip\"' from output" : "Add 'forcepacking=\"unzip\"' to output") + @"
|
||||
11) " + (old ? "Enable XML output" : "Enable ClrMamePro output") + @"
|
||||
12) Merge the DATs
|
||||
@@ -918,7 +917,7 @@ Make a selection:
|
||||
diff = !diff;
|
||||
break;
|
||||
case "9":
|
||||
noDate = !noDate;
|
||||
bare = !bare;
|
||||
break;
|
||||
case "10":
|
||||
forceunpack = !forceunpack;
|
||||
@@ -929,7 +928,7 @@ Make a selection:
|
||||
case "12":
|
||||
Console.Clear();
|
||||
List<string> inputs = new List<string>(input.Split(';'));
|
||||
InitMergeDiff(inputs, name, desc, cat, version, author, diff, dedup, noDate, forceunpack, old);
|
||||
InitMergeDiff(inputs, name, desc, cat, version, author, diff, dedup, bare, forceunpack, old);
|
||||
Console.Write("\nPress any key to continue...");
|
||||
Console.ReadKey();
|
||||
break;
|
||||
@@ -1354,10 +1353,10 @@ Make a selection:
|
||||
/// <param name="author">Author of the DAT</param>
|
||||
/// <param name="diff">True if a DiffDat of all inputs is wanted, false otherwise</param>
|
||||
/// <param name="dedup">True if the outputted file should remove duplicates, false otherwise</param>
|
||||
/// <param name="noDate">True if the date should be omitted from the DAT, false otherwise</param>
|
||||
/// <param name="bare">True if the date should be omitted from the DAT, false otherwise</param>
|
||||
/// <param name="forceunpack">True if the forcepacking="unzip" tag is to be added, false otherwise</param>
|
||||
/// <param name="old">True if a old-style DAT should be output, false otherwise</param>
|
||||
private static void InitMergeDiff(List<string> inputs, string name, string desc, string cat, string version, string author, bool diff, bool dedup, bool noDate, bool forceunpack, bool old)
|
||||
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)
|
||||
{
|
||||
// Make sure there are no folders in inputs
|
||||
List<string> newInputs = new List<string>();
|
||||
@@ -1376,7 +1375,7 @@ Make a selection:
|
||||
}
|
||||
}
|
||||
|
||||
MergeDiff md = new MergeDiff(newInputs, name, desc, cat, version, author, diff, dedup, noDate, forceunpack, old, logger);
|
||||
MergeDiff md = new MergeDiff(newInputs, name, desc, cat, version, author, diff, dedup, bare, forceunpack, old, logger);
|
||||
md.Process();
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace SabreTools
|
||||
// User specified flags
|
||||
private bool _diff;
|
||||
private bool _dedup;
|
||||
private bool _noDate;
|
||||
private bool _bare;
|
||||
private bool _forceunpack;
|
||||
private bool _old;
|
||||
|
||||
@@ -39,12 +39,12 @@ namespace SabreTools
|
||||
/// <param name="author">Author of the DAT</param>
|
||||
/// <param name="diff">True if a DiffDat of all inputs is wanted, false otherwise</param>
|
||||
/// <param name="dedup">True if the outputted file should remove duplicates, false otherwise</param>
|
||||
/// <param name="noDate">True if the date should be omitted from the DAT, false otherwise</param>
|
||||
/// <param name="bare">True if the date should be omitted from the DAT, false otherwise</param>
|
||||
/// <param name="forceunpack">True if the forcepacking="unzip" tag is to be added, false otherwise</param>
|
||||
/// <param name="old">True if a old-style DAT should be output, false otherwise</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 noDate, bool forceunpack, bool old, Logger logger)
|
||||
bool diff, bool dedup, bool bare, bool forceunpack, bool old, Logger logger)
|
||||
{
|
||||
_inputs = inputs;
|
||||
_name = name;
|
||||
@@ -54,7 +54,7 @@ namespace SabreTools
|
||||
_author = author;
|
||||
_diff = diff;
|
||||
_dedup = dedup;
|
||||
_noDate = noDate;
|
||||
_bare = bare;
|
||||
_forceunpack = forceunpack;
|
||||
_old = old;
|
||||
_logger = logger;
|
||||
@@ -106,7 +106,7 @@ namespace SabreTools
|
||||
if (_desc == "")
|
||||
{
|
||||
_desc = (_diff ? "diffdat" : "mergedat") + (_dedup ? "-merged" : "");
|
||||
if (!_noDate)
|
||||
if (!_bare)
|
||||
{
|
||||
_desc += " (" + _date + ")";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user