using System.CommandLine; using MycroForge.CLI.Features; using MycroForge.Core; using MycroForge.Core.Contract; namespace MycroForge.CLI.Commands; public partial class MycroForge { public partial class Add { public class Git : Command, ISubCommandOf { private readonly ProjectContext _context; private readonly List _features; public Git(ProjectContext context, IEnumerable features) : base(Features.Git.FeatureName, "Add git to the project") { _context = context; _features = features.ToList(); this.SetHandler(ExecuteAsync); } private async Task ExecuteAsync() { var feature = _features.First(f => f.Name == Features.Git.FeatureName); await feature.ExecuteAsync(_context); } } } }