24 lines
525 B
C#
24 lines
525 B
C#
using System.CommandLine;
|
|
using MycroForge.CLI.Extensions;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Hosting;
|
|
|
|
using var host = Host
|
|
.CreateDefaultBuilder()
|
|
.ConfigureServices((_, services) =>
|
|
{
|
|
services
|
|
.AddServices()
|
|
.AddCommands();
|
|
})
|
|
.Build();
|
|
|
|
try
|
|
{
|
|
await host.Services.GetRequiredService<MycroForge.CLI.Commands.MycroForge>().InvokeAsync(args);
|
|
}
|
|
catch(Exception e)
|
|
{
|
|
Console.WriteLine(e.Message);
|
|
}
|