Can render command help and application version from inside a command#1133
Can render command help and application version from inside a command#1133FrankRay78 wants to merge 5 commits into
Conversation
|
@microsoft-github-policy-service agree |
patriksvensson
left a comment
There was a problem hiding this comment.
I've been thinking about this for a while.
Wouldn't it be better if we exposed an interface IHelpWriter (like you have in this PR) that contains a method to create the help text from a simplified version of CommandModel?
public interface IHelpProvider
{
IEnumerable<IRenderable> GetHelp(SomeSimplifiedCommandModel model);
}This way, people could design their help text however they want.
|
I've been thinking about this as well, and I agree @patriksvensson . It also starts to tie in with this #1093, which is about separating out initialisation/allowing users to register their own concrete implementations in the DI factory ahead of command parsing etc. I'll have a go at updating this PR and resubmit. |
|
FYI. I'm going to start reworking this PR @patriksvensson. Assuming the help writer improvements in #1252 are generally on point, I'm going to branch from that as a better starting point than main. |
|
Closing, as superseded by #1259 |
Fully implements #702
Also, starts to introduce a clean entry point for allowing spectre.console users (in the future) to override the default HelpWriter with their own implementation, here is where the DI will need to happen,
Spectre.Console.Cli.CommandExecutorline 54: