mycroforge/MicroForge.CLI/Commands/MicroForge.Add.Api.cs
2024-04-21 23:56:27 +02:00

21 lines
647 B
C#

using System.CommandLine;
using MicroForge.CLI.Commands.Interfaces;
using MicroForge.CLI.Features;
namespace MicroForge.CLI.Commands;
public partial class MicroForge
{
public partial class Add
{
public class Api : Command, ISubCommandOf<Add>
{
public Api(ProjectContext context, IEnumerable<IFeature> features) :
base("api", "Add FastAPI to your project")
{
var feature = features.First(f => f.Name == Features.Api.FeatureName);
this.SetHandler(async () => await feature.ExecuteAsync(context));
}
}
}
}