Enable logging in SingleGame

This commit is contained in:
Matt Nadareski
2016-04-19 13:44:16 -07:00
parent 5360744482
commit e357da8388
2 changed files with 9 additions and 0 deletions

View File

@@ -130,6 +130,7 @@ Usage: SingleGame.exe <file|folder> [-r=rootdir|-n]
Options: Options:
-r=rootdir Set the directory name for path size -r=rootdir Set the directory name for path size
-l, --log Enable logging to file
-n Disable single-game mode -n Disable single-game mode
-z Disable forceunzipping -z Disable forceunzipping
"); ");

View File

@@ -40,6 +40,7 @@ namespace SabreTools
_filename = args[0]; _filename = args[0];
bool tofile = false;
if (args.Length > 1) if (args.Length > 1)
{ {
for (int i = 1; i < args.Length; i++) for (int i = 1; i < args.Length; i++)
@@ -52,6 +53,10 @@ namespace SabreTools
case "-z": case "-z":
_forceunpack = false; _forceunpack = false;
break; break;
case "-l":
case "--log":
tofile = true;
break;
default: default:
if (args[i].StartsWith("-r")) if (args[i].StartsWith("-r"))
{ {
@@ -62,6 +67,9 @@ namespace SabreTools
} }
} }
// Set the possibly new value for logger
logger.ToFile = tofile;
_path = (_path == "" ? Environment.CurrentDirectory : _path); _path = (_path == "" ? Environment.CurrentDirectory : _path);
// Drag and drop means quotes; we don't want quotes // Drag and drop means quotes; we don't want quotes