Open
Description
Moved from KathleenDollard/command-line-api-starfruit#49
Question: How can we use Generic Host alongside with the Starfruit?
Context: A lot of open-source projects incorporate Attribute-first approach. But it looks like not so many projects could be used together with Generic Host that easily. AFAIK, Starfruit app model is designed with the idea to hide the complexity and get rid of the dependency on System.CommandLine
. Currently, it is only possible to wire up Generic Host via CommandLineBuilder.UseHost
method
Activity
KathleenDollard commentedon Jun 9, 2020
Thanks for moving this. I definitely want to tie these together.
One key point about StarFruit is that it doesn't have to be attribute (and isn't initially entirely). There's a standard set of rules that use a lot of attributes, but the standard set of rules might evolve.
Yes, the key point of StarFruit is to avoid seeing any, or almost any, System.CommandLine complexity, unless you're doing something super special.
To be honest, I'm just starting to look at this, so what do you think the perfect Main would look like for a non-trivial CLI?
KathleenDollard commentedon Jun 9, 2020
Sorry, nm. I am looking at your PR and will comment afterwards
NikiforovAll commentedon Jun 9, 2020
OK, great. 🙆♂️
I think the DI scenario could be supported by adding a separate package with extension method(s) to configure
CommandLineBuilder
.For example:
System.CommandLine.ReflectionAppModel.DependencyInjection