Open
Description
I want to print all my subcommands or all commands in total, like a typical "--help" command does in most apps.
I actually need this as a string, so i can send it to my client which actually inputs the commands.
Is something like this already included ? Or do i need to craft this by myself, if so... how ?
Glad for any help due to the lack of documentation and the beta guide couldnt help me either.
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
baronfel commentedon Apr 12, 2022
If you run your command via the 'default' CommandLineBuilder, one of the middleware provided handles help in the way you're describing. There's a worked example here if that helps illustrate the usage?
jonsequitur commentedon Apr 12, 2022
If you want to get the help output as a string, you can use the

HelpBuilder
directly:genaray commentedon Apr 15, 2022
Thanks a lot ! This already helped :)
One little problem left, my root command has several subcommands registered. Those subcommands have options and stuff.
When i use the HelpBuilder to generate that describtion, it mentions my subcommands... but not the options of my subcommands. However i added an describtion for them.
Is there a way to use the help builder to generate a whole describtion for the whole command tree ?
jonsequitur commentedon Apr 15, 2022
Not currently, but take a look at custom help layouts. These APIs are intended to enable this kind of customization.
https://docs.microsoft.com/en-us/dotnet/standard/commandline/customize-help