Make SingleGame more flexible

This commit is contained in:
Matt Nadareski
2016-04-19 14:00:09 -07:00
parent e357da8388
commit f9bf8ec836
2 changed files with 23 additions and 24 deletions

View File

@@ -126,7 +126,7 @@ Options:
case "SingleGame":
Console.WriteLine(@"SingleGame - Process DATs for use in server environments
-----------------------------------------
Usage: SingleGame.exe <file|folder> [-r=rootdir|-n]
Usage: SingleGame.exe [option] [filename|dirname]
Options:
-r=rootdir Set the directory name for path size

View File

@@ -38,14 +38,10 @@ namespace SabreTools
// Output the title
Build.Start("SingleGame");
_filename = args[0];
bool tofile = false;
if (args.Length > 1)
foreach (string arg in args)
{
for (int i = 1; i < args.Length; i++)
{
switch (args[i])
switch (arg)
{
case "-n":
_rename = false;
@@ -58,14 +54,17 @@ namespace SabreTools
tofile = true;
break;
default:
if (args[i].StartsWith("-r"))
if (arg.StartsWith("-r"))
{
_path = args[i].Split('=')[1];
_path = arg.Split('=')[1];
}
else
{
_filename = arg;
}
break;
}
}
}
// Set the possibly new value for logger
logger.ToFile = tofile;