using System.CommandLine; using Autofac; using SampleTool; namespace MfGames.ToolBuilder { /// /// The Autofac module to pull in the components inside this assembly. /// public class SampleToolModule : Module { /// protected override void Load(ContainerBuilder builder) { builder .RegisterAssemblyTypes(this.GetType().Assembly) .AsSelf() .AsImplementedInterfaces(); builder .Register( c => { var root = new RootCommand { Name = "sample-tool", Description = "A sample tool that demonstrates functionality", }; root.AddCommand(c.Resolve()); root.AddCommand(c.Resolve()); root.AddCommand(c.Resolve()); return root; }) .AsSelf(); } } }