From 135997a7cd922c2f4fe84445bf95bd995265bc6f Mon Sep 17 00:00:00 2001 From: Tim Van Baak Date: Sat, 10 Aug 2024 14:54:03 -0700 Subject: [PATCH] Add a real CLI for adjudication --- .../CommandLine/AdjudicateOptions.cs | 15 +++++++++++++++ .../MultiversalDiplomacy.csproj | 4 ++++ MultiversalDiplomacy/Program.cs | 19 ++++++++++++------- 3 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 MultiversalDiplomacy/CommandLine/AdjudicateOptions.cs diff --git a/MultiversalDiplomacy/CommandLine/AdjudicateOptions.cs b/MultiversalDiplomacy/CommandLine/AdjudicateOptions.cs new file mode 100644 index 0000000..67fca84 --- /dev/null +++ b/MultiversalDiplomacy/CommandLine/AdjudicateOptions.cs @@ -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(); + } +} diff --git a/MultiversalDiplomacy/MultiversalDiplomacy.csproj b/MultiversalDiplomacy/MultiversalDiplomacy.csproj index 91b464a..dbb9910 100644 --- a/MultiversalDiplomacy/MultiversalDiplomacy.csproj +++ b/MultiversalDiplomacy/MultiversalDiplomacy.csproj @@ -7,4 +7,8 @@ enable + + + + diff --git a/MultiversalDiplomacy/Program.cs b/MultiversalDiplomacy/Program.cs index f6d0fcb..72c0334 100644 --- a/MultiversalDiplomacy/Program.cs +++ b/MultiversalDiplomacy/Program.cs @@ -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(args); + + parseResult + .WithParsed(AdjudicateOptions.Execute); } } \ No newline at end of file