30 lines
824 B
C#
30 lines
824 B
C#
namespace FinalFactory.Rendezvous.TestClient;
|
|
|
|
public static class Program
|
|
{
|
|
public static async Task<int> Main(string[] args)
|
|
{
|
|
using CancellationTokenSource shutdown = new();
|
|
ConsoleCancelEventHandler cancelHandler = (_, eventArgs) =>
|
|
{
|
|
eventArgs.Cancel = true;
|
|
shutdown.Cancel();
|
|
};
|
|
Console.CancelKeyPress += cancelHandler;
|
|
try
|
|
{
|
|
TestClientApplication application = new(new RendezvousCommandRunner());
|
|
return await application.RunAsync(
|
|
args,
|
|
Console.In,
|
|
Console.Out,
|
|
Console.Error,
|
|
shutdown.Token).ConfigureAwait(false);
|
|
}
|
|
finally
|
|
{
|
|
Console.CancelKeyPress -= cancelHandler;
|
|
}
|
|
}
|
|
}
|