5dplomacy/MultiversalDiplomacy/Program.cs

41 lines
1.1 KiB
C#
Raw Normal View History

2022-02-12 19:33:03 +00:00
using System;
2022-11-06 22:34:58 +00:00
using CommandLine;
using CommandLine.Text;
2022-02-12 19:33:03 +00:00
namespace MultiversalDiplomacy
{
2022-11-06 22:34:58 +00:00
[Verb("adjudicate", HelpText = "")]
internal class AdjudicateOptions
{
[Option('i', "input")]
public string? InputFile { get; set; }
}
2022-02-12 19:33:03 +00:00
internal class Program
{
static void Main(string[] args)
{
2022-11-06 22:34:58 +00:00
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<AdjudicateOptions>(Adjudicate)
.WithNotParsed(errs => Console.WriteLine(helpText));
}
static void Adjudicate(AdjudicateOptions args)
{
2022-02-12 19:33:03 +00:00
}
}
}