spectreconsole / spectre.console

A .NET library that makes it easier to create beautiful console applications.
https://spectreconsole.net
MIT License
9.45k stars 499 forks source link

SetDefault does not work as expected #1588

Open LLSavion opened 3 months ago

LLSavion commented 3 months ago
config.AddBranch("doSomething", add =>
{
    add.SetDefaultCommand<ACommand>();
    add.AddCommand<ACommand>("normal").WithData(contextData).WithDescription("Merge 'Models'.");
    add.AddCommand<BCommand>("different").WithData(contextData).WithDescription("Merge models using a session file.");
});

So in my opinion if I write "doSomething normal --parameters" it should be equal to "doSomething --parameters"! However when I enter them they both execute the Execute-Function in the ACommand but when I leave out the normal and just write "doSomething --parameters" the parameters in the settings are null instead of the values I passed.

LLSavion commented 3 months ago

These settings: grafik

LLSavion commented 3 months ago

Conclusion: "doSomething normal --parameters" parameters in the settings are there "doSomething --parameters" parameters in the settings are null Both are ACommand And ACommand is set to default.

LLSavion commented 2 months ago

When can I expect it?

patriksvensson commented 2 months ago

Probably when someone submits a PR for it and it passes review etc.