-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgram.cs
More file actions
53 lines (44 loc) · 1.46 KB
/
Program.cs
File metadata and controls
53 lines (44 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System.CommandLine;
using System.CommandLine.Builder;
using System.CommandLine.Parsing;
namespace ModShardDiff;
internal static class Program
{
static async Task Main(string[] args)
{
Option<string> nameOption = new("--name")
{
Description = "Name of the file to be compared to.",
IsRequired = true
};
nameOption.AddAlias("-n");
nameOption.SetDefaultValue(null);
Option<string> refOption = new("--ref")
{
Description = "Name of the reference to compare to.",
IsRequired = true
};
refOption.AddAlias("-r");
Option<string?> outputOption = new("--output")
{
Description = "Output folder for the diff files."
};
outputOption.AddAlias("-o");
outputOption.SetDefaultValue(null);
RootCommand rootCommand = new("A CLI tool to export diff files from two data.win.")
{
nameOption,
refOption,
outputOption
};
rootCommand.SetHandler(MainOperations.MainCommand, nameOption, refOption, outputOption);
CommandLineBuilder commandLineBuilder = new(rootCommand);
commandLineBuilder.AddMiddleware(async (context, next) =>
{
await next(context);
});
commandLineBuilder.UseDefaults();
Parser parser = commandLineBuilder.Build();
await parser.InvokeAsync(args);
}
}