-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
24 lines (20 loc) · 880 Bytes
/
Program.cs
File metadata and controls
24 lines (20 loc) · 880 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using CommandLine;
using KCNLanzouDirectLink.Command.Commands;
using KCNLanzouDirectLink.Command.Options;
using KCNLanzouDirectLink.Command.Services;
namespace KCNLanzouDirectLink.Command;
public static class Program
{
public static async Task<int> Main(string[] args)
{
var outputService = new ConsoleOutputService();
var result = await Parser.Default.ParseArguments<GetLinkOptions, GetInfoOptions, BatchOptions>(args)
.MapResult(
async (GetLinkOptions opts) => await new GetLinkCommand(outputService).ExecuteAsync(opts),
async (GetInfoOptions opts) => await new GetInfoCommand(outputService).ExecuteAsync(opts),
async (BatchOptions opts) => await new BatchCommand(outputService).ExecuteAsync(opts),
errs => Task.FromResult(1)
);
return result;
}
}