Well, got a basic help handling. The abstraction feels just a tad rough but it may be okay? Mostly, I don't want to require someone to always add --help
to the commands.
> ./CliHostingWithAbstractionsOnly
info: CliHostingWithAbstractionsOnly.ExampleRootCommand[0] I'm running! False
info: CliHostingWithAbstractionsOnly.MyService[0] Doing something
> ./CliHostingWithAbstractionsOnly --help
I need help! 1
> ./CliHostingWithAbstractionsOnly --bob
I need help! 1
fail: CliHostingWithAbstractionsOnly.ExampleRootCommand[0] Unknown argument: --bob
I might consider implementing global arguments, but I'm leaning away from that. Instead, I will probably implement common argument sets that can be injected via DI instead.
But, not bad coding for an hour?
#CSharp #ReinventingTheWheel