spectre.console
spectre.console copied to clipboard
AddBranch() is never explained in the documentation
AddBranch() is never explained in the documentation.
For Instance, in your CLI Demo App:
app.Configure(config =>
{
config.SetApplicationName("fake-dotnet");
config.ValidateExamples();
config.AddExample(new[] { "run", "--no-build" });
// Run
config.AddCommand<RunCommand>("run");
// Add
**config.AddBranch<AddSettings>("add", add =>**
{
add.SetDescription("Add a package or reference to a .NET project");
add.AddCommand<AddPackageCommand>("package");
add.AddCommand<AddReferenceCommand>("reference");
});
@dlandi to clarify: You are referring to the fact that branches are never really explained on the website, right?
The AddBranch() method, itself, appears undocumented. If there is documentation for it then please let me know where.
Thanks. And great job so far on this library. I am using it in a real project.
-dennis
The AddBranch() method, itself, appears undocumented.
I feel like I'm a bit slow today, sorry. Do you mean in-code (xml) documentation that appears in your IDE?
OK. Here is the in-code comments for AddBranch()

As a newcomer to this library, I need a little more documentation. In my opinion, the explanation should go on your website since you are using it in your sample code to show how your library works.
I really can't decipher what this code is doing by the semantics. Does AddBranch add a command "link" to a command "chain"; or a branch to a tree?
A little more explanation somewhere would be helpful.
-dennis
The requirements of a PR to address this issue is:
- Explain the usage of
AddBranchon the following page: https://spectreconsole.net/cli/composing, see:
Suggested fix to consider:
Consider splitting out the example into two sections, first giving a code example without the use of a branch eg:
And then giving a second example that uses the AddBranch method, providing an adequate explanation of what it does (eg. composition of nested commands / inherited command settings)