Add new features requested by Obiwantje

This commit is contained in:
Matt Nadareski
2016-04-20 13:20:50 -07:00
parent dc0cd4f153
commit ec54249ab6
3 changed files with 31 additions and 6 deletions

View File

@@ -33,7 +33,7 @@ namespace SabreTools
// Output the title
Build.Start("DatToMiss");
string prefix = "", postfix = "", input = "";
string prefix = "", postfix = "", input = "", addext = "", repext = "";
bool tofile = false, help = false, usegame = true, quotes = false;
foreach (string arg in args)
{
@@ -57,14 +57,22 @@ namespace SabreTools
quotes = true;
break;
default:
if ((arg.StartsWith("-pre=") || arg.StartsWith("--prefix=")) && prefix == "")
if (arg.StartsWith("-pre=") || arg.StartsWith("--prefix="))
{
prefix = arg.Split('=')[1];
}
else if ((arg.StartsWith("-post=") || arg.StartsWith("--postfix=")) && postfix == "")
else if (arg.StartsWith("-post=") || arg.StartsWith("--postfix="))
{
postfix = arg.Split('=')[1];
}
else if (arg.StartsWith("-ae=") || arg.StartsWith("-add-ext="))
{
addext = arg.Split('=')[1];
}
else if (arg.StartsWith("-re=") || arg.StartsWith("-rep-ext="))
{
repext = arg.Split('=')[1];
}
else if (input == "" && File.Exists(arg.Replace("\"", "")))
{
input = arg.Replace("\"", "");
@@ -93,7 +101,7 @@ namespace SabreTools
name += Path.GetFileNameWithoutExtension(input) + "-miss.txt";
// Read in the roms from the DAT and then write them to the file
Output.WriteToText(name, Path.GetDirectoryName(input), RomManipulation.Parse(input, 0, 0, logger), logger, usegame, prefix, postfix, quotes);
Output.WriteToText(name, Path.GetDirectoryName(input), RomManipulation.Parse(input, 0, 0, logger), logger, usegame, prefix, postfix, addext, repext, quotes);
}
}
}