mirror of
https://github.com/OatmealDome/Rotationator.git
synced 2026-04-25 07:37:01 -05:00
Program: Switch to using InvocationContext for command handling
This commit is contained in:
parent
c19673787a
commit
88f893982b
|
|
@ -1,4 +1,5 @@
|
|||
using System.CommandLine;
|
||||
using System.CommandLine.Invocation;
|
||||
using System.Text.Json;
|
||||
using OatmealDome.BinaryData;
|
||||
using OatmealDome.NinLib.Byaml;
|
||||
|
|
@ -68,7 +69,7 @@ Command command = new RootCommand("Generates a new VSSetting BYAMl file.")
|
|||
outputByamlArg
|
||||
};
|
||||
|
||||
command.SetHandler((lastPath, outPath) => Run(lastPath, outPath), lastByamlArg, outputByamlArg);
|
||||
command.SetHandler(context => Run(context));
|
||||
|
||||
command.Invoke(args);
|
||||
|
||||
|
|
@ -76,9 +77,12 @@ command.Invoke(args);
|
|||
// Entrypoint
|
||||
//
|
||||
|
||||
void Run(string lastByamlPath, string outputByamlPath)
|
||||
void Run(InvocationContext context)
|
||||
{
|
||||
Console.WriteLine("run");
|
||||
|
||||
string lastByamlPath = context.ParseResult.GetValueForArgument(lastByamlArg);
|
||||
string outputByamlPath = context.ParseResult.GetValueForArgument(outputByamlArg);
|
||||
|
||||
dynamic lastByaml = ByamlFile.Load(lastByamlPath);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user