From c4a14f1d7ecd05cb84515d350225c9f1531b04a2 Mon Sep 17 00:00:00 2001 From: Jaculabilis Date: Sun, 6 Nov 2022 14:34:58 -0800 Subject: [PATCH] tmp --- .../MultiversalDiplomacy.csproj | 4 +++ MultiversalDiplomacy/Program.cs | 31 ++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/MultiversalDiplomacy/MultiversalDiplomacy.csproj b/MultiversalDiplomacy/MultiversalDiplomacy.csproj index 74abf5c..d69c7d1 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..91a719a 100644 --- a/MultiversalDiplomacy/Program.cs +++ b/MultiversalDiplomacy/Program.cs @@ -1,12 +1,41 @@ using System; +using CommandLine; +using CommandLine.Text; + namespace MultiversalDiplomacy { + [Verb("adjudicate", HelpText = "")] + internal class AdjudicateOptions + { + [Option('i', "input")] + public string? InputFile { get; set; } + } + internal class Program { static void Main(string[] args) { - Console.WriteLine("stab"); + var parser = new Parser(options => + { + options.AutoVersion = false; + options.HelpWriter = null; + }); + var parseResult = parser.ParseArguments(args, typeof(AdjudicateOptions)); + var helpText = HelpText.AutoBuild(parseResult, options => + { + options.AdditionalNewLineAfterOption = false; + return HelpText.DefaultParsingErrorsHandler(parseResult, options); + }); + + parseResult + .WithParsed(Adjudicate) + .WithNotParsed(errs => Console.WriteLine(helpText)); + } + + static void Adjudicate(AdjudicateOptions args) + { + } } } \ No newline at end of file