You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classProgram{publicstaticasyncTaskMain(string[]args)=>awaitCreateHostBuilder(args).RunConsoleAsyncWithModules();publicstaticIHostBuilderCreateHostBuilder(string[]args)=>Host.CreateDefaultBuilder(args).ConfigureServices((hostContext,services)=>{services.AddModules(builder =>{builder.UseCommandLineModules().AddModule<AModule>();});});}[Command]publicclassLogCommand:ModuleCommand<AModule>{publicLogCommand(AModulemodule):base(module){}// Order: 0[CommandParameter(0,Description="Value whose logarithm is to be found.")]publicdoubleValue{get;init;}// Name: --base// Short name: -b[CommandOption("base",'b',Description="Logarithm base.")]publicdoubleBase{get;init;}=10;protectedoverrideValueTaskExecuteAsync(IConsoleconsole,CancellationTokencancellationToken=default){varresult=Math.Log(Value,Base);console.Output.WriteLine(result);console.Output.WriteLine($"From Module {Module.Manifest.DisplayName}.");returndefault;}}[CommandFrom(typeof(LogCommand))]publicclassAModule:CommandLineModule{publicAModule(IModuleHosthost):base(host){}}