Cysharp / ConsoleAppFramework

Zero Dependency, Zero Overhead, Zero Reflection, Zero Allocation, AOT Safe CLI Framework powered by C# Source Generator.
MIT License
1.54k stars 88 forks source link

[RootCommand] for each ConsoleAppBase class #95

Closed Floge123 closed 1 year ago

Floge123 commented 1 year ago

I have 3 classes (A, B, C) to structure my commands. Now i want to have a RootCommand for each of those classes. I added [RootCommand] over a Function (Func) for each class. The expected result would be that i can use it like this:

MyTool A
MyTool B
MyTool C

However this does not seem to work, as i have to use it like this:

MyTool A Func
MyTool B Func
MyTool C Func

Is there something wrong with my setup or am i misunderstanding how [RootCommand] should work?

Floge123 commented 1 year ago

I start the app like this:

var app = ConsoleApp.CreateBuilder(args).ConfigureServices((hostContext, services) =>
{
    //add services
}).Build();

app.AddAllCommandType();
app.Run();
github-actions[bot] commented 1 year ago

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 30 days.