[RombaSharp] Add the flag for Rescan

This commit is contained in:
Matt Nadareski
2016-10-17 11:27:50 -07:00
parent 946a8d81f3
commit 62803fbd70
2 changed files with 17 additions and 3 deletions

View File

@@ -73,6 +73,7 @@ namespace SabreTools
build = false,
copy = false,
dbstats = false,
depotRescan = false,
diffdat = false,
dir2dat = false,
export = false,
@@ -112,6 +113,9 @@ namespace SabreTools
case "dbstats":
dbstats = true;
break;
case "depot-rescan":
depotRescan = true;
break;
case "diffdat":
diffdat = true;
break;
@@ -180,8 +184,8 @@ namespace SabreTools
}
// If more than one switch is enabled, show the help screen
if (!(archive ^ build ^ dbstats ^ diffdat ^ dir2dat ^ export ^ fixdat ^ lookup ^ memstats ^
miss ^ progress ^ purgeBackup ^ purgeDelete ^ refreshDats ^ shutdown))
if (!(archive ^ build ^ dbstats ^ depotRescan ^ diffdat ^ dir2dat ^ export ^ fixdat ^ lookup ^
memstats ^ miss ^ progress ^ purgeBackup ^ purgeDelete ^ refreshDats ^ shutdown))
{
_logger.Error("Only one feature switch is allowed at a time");
Build.Help();
@@ -190,7 +194,7 @@ namespace SabreTools
}
// If a switch that requires a filename is set and no file is, show the help screen
if (inputs.Count == 0 && (archive || build || dir2dat || fixdat || lookup || miss))
if (inputs.Count == 0 && (archive || build || depotRescan || dir2dat || fixdat || lookup || miss))
{
_logger.Error("This feature requires at least one input");
Build.Help();
@@ -218,6 +222,15 @@ namespace SabreTools
DisplayDBStats();
}
// Rescan a specific depot
else if (depotRescan)
{
foreach (string input in inputs)
{
Rescan(input);
}
}
// Creates a DAT file with those entries that are in new DAT
else if (diffdat)
{

View File

@@ -85,6 +85,7 @@ namespace SabreTools.Helper
helptext.Add(" build For each specified DAT file it creates TZip files");
helptext.Add(" -copy Copy files instead of rebuilding");
helptext.Add(" dbstats Prints db stats");
helptext.Add(" depot-rescan Rescan a specific depot to get new information");
helptext.Add(" diffdat Creates a DAT file for entries found in the new DAT");
helptext.Add(" -new= DAT to compare to");
helptext.Add(" dir2dat Creates a DAT file for the specified input directory");