Add option for copy protection file output (fixes #372)

This commit is contained in:
Matt Nadareski
2022-04-10 22:12:20 -07:00
parent 87c441887a
commit 58c53ff5e2
7 changed files with 75 additions and 4 deletions

View File

@@ -69,7 +69,7 @@ namespace MPF.Check
string username = null, password = null;
string internalProgram = "DiscImageCreator";
string path = string.Empty;
bool scan = false, compress = false, json = false;
bool scan = false, protectFile = false, compress = false, json = false;
// Loop through and process options
int startIndex = 2;
@@ -117,6 +117,12 @@ namespace MPF.Check
scan = true;
}
// Output protection to separate file (requires scan for protection)
else if (args[startIndex].Equals("-f") || args[startIndex].Equals("--protect-file"))
{
protectFile = true;
}
// Output submission JSON
else if (args[startIndex].Equals("-j") || args[startIndex].Equals("--json"))
{
@@ -175,6 +181,7 @@ namespace MPF.Check
{
InternalProgram = EnumConverter.ToInternalProgram(internalProgram),
ScanForProtection = scan && !string.IsNullOrWhiteSpace(path),
OutputSeparateProtectionFile = scan && protectFile && !string.IsNullOrWhiteSpace(path),
PromptForDiscInformation = false,
ShowDiscEjectReminder = false,
OutputSubmissionJSON = json,
@@ -219,6 +226,7 @@ namespace MPF.Check
Console.WriteLine("-u, --use <program> Dumping program output type");
Console.WriteLine("-p, --path <drivepath> Physical drive path for additional checks");
Console.WriteLine("-s, --scan Enable copy protection scan (requires --path)");
Console.WriteLine("-f, --protect-file Output protection to separate file (requires --scan)");
Console.WriteLine("-j, --json Enable submission JSON output");
Console.WriteLine("-z, --zip Enable log file compression");
Console.WriteLine();