Add a real CLI for adjudication

This commit is contained in:
Tim Van Baak 2024-08-10 14:54:03 -07:00
parent 9fd63f4317
commit 135997a7cd
3 changed files with 31 additions and 7 deletions

View File

@ -0,0 +1,15 @@
using CommandLine;
namespace MultiversalDiplomacy.CommandLine;
[Verb("adjudicate", HelpText = "Adjudicate a Multiversal Diplomacy game state.")]
public class AdjudicateOptions
{
[Value(0, HelpText = "Input file describing the game state to adjudicate, or - to read from stdin.")]
public string? InputFile { get; set; }
public static void Execute(AdjudicateOptions args)
{
throw new NotImplementedException();
}
}

View File

@ -7,4 +7,8 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.9.1" />
</ItemGroup>
</Project> </Project>

View File

@ -1,12 +1,17 @@
using System; using CommandLine;
namespace MultiversalDiplomacy using MultiversalDiplomacy.CommandLine;
namespace MultiversalDiplomacy;
internal class Program
{ {
internal class Program
{
static void Main(string[] args) static void Main(string[] args)
{ {
Console.WriteLine("stab"); var parser = Parser.Default;
} var parseResult = parser.ParseArguments<AdjudicateOptions>(args);
parseResult
.WithParsed(AdjudicateOptions.Execute);
} }
} }