mycroforge/MycroForge.CLI/Commands/MycroForge.Add.Api.cs

21 lines
647 B
C#

using System.CommandLine;
using MycroForge.CLI.Commands.Interfaces;
using MycroForge.CLI.Features;
namespace MycroForge.CLI.Commands;
public partial class MycroForge
{
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));
}
}
}
}