dotnet / dotnet/command-line-api
Add generic host builder pattern for System.CommandLine.Hosting
- Dominant language
- C#
- Stars
- 3.7k
- Forks
- 428
- PR merge metrics
- No merged PRs in 30d
Description
Align `System.CommadLine.Hosting` model with the way ASP.NET Core uses _Generic Host_.
It should be possible to configure CommandLineBuilder like this:
```csharp
public static IHostBuilder CreateHostBuilder(string[] args) =>
CommandLineHost.CreateDefaultBuilder(args)
.ConfigureAppConfiguration((hostingContext, config) =>
{
})
.ConfigureCommandLineDefaults(cmdHost =>
{
cmdHost.ConfigureServices(services =>
{
})
})
.ConfigureCommandLineBuilder(cmdBuilder => // CommandLineBuilder
{
cmdBuilder.UseReflectionAppModel(); // e.g. https://github.com/KathleenDollard/command-line-api-starfruit
});
});
```
Contributor guide
Assessment
This issue has not been assessed yet.