feat: Dynamic command loader, default command with module registry

This commit is contained in:
2025-04-20 12:38:27 +02:00
parent a7cae86254
commit cea3d11a41
13 changed files with 373 additions and 3 deletions

24
Common/TypeResolver.cs Normal file
View File

@ -0,0 +1,24 @@
using Microsoft.Extensions.DependencyInjection;
using Spectre.Console.Cli;
namespace Automancer.Common;
public sealed class TypeResolver : ITypeResolver, IDisposable
{
private readonly ServiceProvider _provider;
public TypeResolver(ServiceProvider provider)
{
_provider = provider;
}
public object? Resolve(Type? type)
{
return type is null ? null : _provider.GetService(type);
}
public void Dispose()
{
_provider.Dispose();
}
}