mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[OfflineMerge, SabreTools] Integrate OfflineMerge
Along with this change are miscellaneous fixes to make it more useful.
This commit is contained in:
@@ -91,6 +91,7 @@ namespace SabreTools
|
||||
disableForce = false,
|
||||
enableGzip = false,
|
||||
extsplit = false,
|
||||
fake = false,
|
||||
forceunpack = false,
|
||||
generate = false,
|
||||
genall = false,
|
||||
@@ -104,6 +105,7 @@ namespace SabreTools
|
||||
noMD5 = false,
|
||||
norename = false,
|
||||
noSHA1 = false,
|
||||
offlineMerge = false,
|
||||
old = false,
|
||||
outputCMP = false,
|
||||
outputMiss = false,
|
||||
@@ -130,6 +132,9 @@ namespace SabreTools
|
||||
category = "",
|
||||
comment = "",
|
||||
crc = "",
|
||||
currentAllMerged = "",
|
||||
currentMissingMerged = "",
|
||||
currentNewMerged = "",
|
||||
date = "",
|
||||
description = "",
|
||||
email = "",
|
||||
@@ -230,6 +235,10 @@ namespace SabreTools
|
||||
case "--files":
|
||||
archivesAsFiles = true;
|
||||
break;
|
||||
case "-fk":
|
||||
case "--fake":
|
||||
fake = true;
|
||||
break;
|
||||
case "-g":
|
||||
case "--generate":
|
||||
generate = true;
|
||||
@@ -302,6 +311,10 @@ namespace SabreTools
|
||||
case "--output-cmp":
|
||||
outputCMP = true;
|
||||
break;
|
||||
case "-ol":
|
||||
case "--offmerge":
|
||||
offlineMerge = true;
|
||||
break;
|
||||
case "-om":
|
||||
case "--output-miss":
|
||||
outputMiss = true;
|
||||
@@ -382,6 +395,10 @@ namespace SabreTools
|
||||
{
|
||||
comment = arg.Split('=')[1];
|
||||
}
|
||||
else if (arg.StartsWith("-com=") || arg.StartsWith("--com="))
|
||||
{
|
||||
currentAllMerged = arg.Split('=')[1];
|
||||
}
|
||||
else if (arg.StartsWith("-crc=") || arg.StartsWith("--crc="))
|
||||
{
|
||||
crc = arg.Split('=')[1];
|
||||
@@ -410,6 +427,10 @@ namespace SabreTools
|
||||
{
|
||||
filename = arg.Split('=')[1];
|
||||
}
|
||||
else if (arg.StartsWith("-fix=") || arg.StartsWith("--fix="))
|
||||
{
|
||||
currentMissingMerged = arg.Split('=')[1];
|
||||
}
|
||||
else if (arg.StartsWith("-fm=") || arg.StartsWith("--forcemerge="))
|
||||
{
|
||||
forcemerge = arg.Split('=')[1];
|
||||
@@ -450,6 +471,10 @@ namespace SabreTools
|
||||
{
|
||||
name = arg.Split('=')[1];
|
||||
}
|
||||
else if (arg.StartsWith("-new=") || arg.StartsWith("--new="))
|
||||
{
|
||||
currentNewMerged = arg.Split('=')[1];
|
||||
}
|
||||
else if (arg.StartsWith("-out=") && outdir == "")
|
||||
{
|
||||
outdir = arg.Split('=')[1];
|
||||
@@ -558,8 +583,9 @@ namespace SabreTools
|
||||
}
|
||||
|
||||
// If more than one switch is enabled, show the help screen
|
||||
if (!(add ^ datfromdir ^ extsplit ^ generate ^ genall ^ hashsplit ^ import ^ listsrc ^ listsys ^ (merge || diff) ^
|
||||
(update || outputCMP || outputRC || outputSD || outputXML || outputMiss || romba) ^ rem ^ stats ^ trim))
|
||||
if (!(add ^ datfromdir ^ extsplit ^ generate ^ genall ^ hashsplit ^ import ^ listsrc ^ listsys ^
|
||||
(merge || diff) ^ (update || outputCMP || outputRC || outputSD || outputXML || outputMiss || romba) ^
|
||||
offlineMerge ^ rem ^ stats ^ trim))
|
||||
{
|
||||
_logger.Error("Only one feature switch is allowed at a time");
|
||||
Build.Help();
|
||||
@@ -696,6 +722,22 @@ namespace SabreTools
|
||||
InitDatFromDir(inputs, filename, name, description, category, version, author, forceunpack, old, romba, superdat, noMD5, noSHA1, bare, archivesAsFiles, enableGzip, tempdir);
|
||||
}
|
||||
|
||||
// If we want to run Offline merging mode
|
||||
else if (offlineMerge)
|
||||
{
|
||||
if (!(currentAllMerged == "" && currentMissingMerged == "" && currentNewMerged == ""))
|
||||
{
|
||||
InitOfflineMerge(currentAllMerged, currentMissingMerged, currentNewMerged, fake);
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.User("All inputs were empty! At least one input is required...");
|
||||
Build.Help();
|
||||
_logger.Close();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// If nothing is set, show the help
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user