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 GitIgnore : Command, ISubCommandOf { private readonly ProjectContext _context; private readonly List _features; public GitIgnore(ProjectContext context, IEnumerable features) : base(Features.GitIgnore.FeatureName, "Add a default .gitignore file to the project") { _context = context; _features = features.ToList(); this.SetHandler(ExecuteAsync); } private async Task ExecuteAsync() { var feature = _features.First(f => f.Name == Features.GitIgnore.FeatureName); await feature.ExecuteAsync(_context); } } } }