25 lines
603 B
C#
25 lines
603 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
|
|
.RegisterCommandDefaults()
|
|
.RegisterCommandPlugins()
|
|
;
|
|
})
|
|
.Build();
|
|
|
|
try
|
|
{
|
|
await host.Services.GetRequiredService<MycroForge.CLI.Commands.MycroForge>()
|
|
.InvokeAsync(args.Length == 0 ? ["--help"] : args);
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
Console.WriteLine(e.Message);
|
|
} |