fixed argument parser
This commit is contained in:
@@ -14,17 +14,17 @@ try
|
||||
string? searchQuery = null;
|
||||
|
||||
new LaunchArgumentParser(
|
||||
new LaunchArgument(["-i", "--input"],
|
||||
new LaunchArgument(["i", "input"],
|
||||
"Set input file path",
|
||||
s => inputPath = s,
|
||||
"gamestate or zip file"),
|
||||
|
||||
new LaunchArgument(["-o", "--output"],
|
||||
new LaunchArgument(["o", "output"],
|
||||
"Set output file path",
|
||||
s => outputPath = s,
|
||||
"json file [default=stdout]"),
|
||||
|
||||
new LaunchArgument(["-s", "--search"],
|
||||
new LaunchArgument(["s", "search"],
|
||||
"Search in input file",
|
||||
s =>
|
||||
{
|
||||
|
||||
@@ -76,6 +76,7 @@ public class SaveParsingOperation
|
||||
Dictionary<string, object> parsedData;
|
||||
await using (var gamestateStream = PathHelper.CreateTempFile())
|
||||
{
|
||||
// TODO: ckeck if it is zip archive or plain text like in Search.cs
|
||||
using (var zipArchive = ZipFile.Open(_meta.GetSaveFilePath().Str, ZipArchiveMode.Read))
|
||||
{
|
||||
var zipEntry = zipArchive.Entries.FirstOrDefault(e => e.Name == "gamestate");
|
||||
|
||||
@@ -40,7 +40,7 @@ public static class Program
|
||||
#endif
|
||||
|
||||
new LaunchArgumentParser(
|
||||
new LaunchArgument(["-d", "--debug"],
|
||||
new LaunchArgument(["d", "debug"],
|
||||
"enables debug log output to console",
|
||||
() => IsDebug = true)
|
||||
).AllowNoArguments().ParseAndHandle(args);
|
||||
|
||||
Reference in New Issue
Block a user