Skip to content

Commit

Permalink
Try again...
Browse files Browse the repository at this point in the history
  • Loading branch information
R-YaTian committed Aug 1, 2024
1 parent 0205c32 commit ffc7347
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions Tinke/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ static void Main(string[] args)
Console.WriteLine();
}
Parser.Default.ParseArguments<ExtractOptions, ReplaceOptions, OpenOptions>(args)
.WithParsed(HandleArgs)
.WithParsed<ExtractOptions>(RunExtract)
.WithParsed<ReplaceOptions>(RunReplace)
.WithParsed<OpenOptions>(RunOpen)
.WithNotParsed(HandleErrors);
if (Type.GetType("Mono.Runtime") == null && curCommand == 0)
{
Expand Down Expand Up @@ -191,22 +193,6 @@ private static void RunOpen(OpenOptions opts)
bIsFolder = opts.IsFolder;
}

private static void HandleArgs(object obj)
{
switch (obj)
{
case ExtractOptions e:
RunExtract(e);
break;
case ReplaceOptions p:
RunReplace(p);
break;
case OpenOptions o:
RunOpen(o);
break;
}
}

private static void HandleErrors(IEnumerable<Error> obj)
{
curCommand = 0;
Expand Down

0 comments on commit ffc7347

Please sign in to comment.