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": case "SingleGame":
Console.WriteLine(@"SingleGame - Process DATs for use in server environments 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: Options:
-r=rootdir Set the directory name for path size -r=rootdir Set the directory name for path size

View File

@@ -38,32 +38,31 @@ namespace SabreTools
// Output the title // Output the title
Build.Start("SingleGame"); Build.Start("SingleGame");
_filename = args[0];
bool tofile = false; bool tofile = false;
if (args.Length > 1) foreach (string arg in args)
{ {
for (int i = 1; i < args.Length; i++) switch (arg)
{ {
switch (args[i]) case "-n":
{ _rename = false;
case "-n": break;
_rename = false; case "-z":
break; _forceunpack = false;
case "-z": break;
_forceunpack = false; case "-l":
break; case "--log":
case "-l": tofile = true;
case "--log": break;
tofile = true; default:
break; if (arg.StartsWith("-r"))
default: {
if (args[i].StartsWith("-r")) _path = arg.Split('=')[1];
{ }
_path = args[i].Split('=')[1]; else
} {
break; _filename = arg;
} }
break;
} }
} }