-
Notifications
You must be signed in to change notification settings - Fork 409
Open
Description
Hi team,
while building .NET apps (console, WPF, Windows-Service) on top of System.CommandLine, I often combine it with Microsoft.Extensions.Hosting.
Today each app must:
• parse args manually,
• inject ParseResult into DI,
• handle --help / validation,
• wire optional post-parse configuration.
I propose a small host extension:
Host.CreateDefaultBuilder(args)
.UseSystemCommandLine(rootCommand, args, (parseResult, services) =>
{
// optional post-parse configuration
});
Benefits:
• Unified startup for console, WPF and service apps
• Single parse before building the host
• DI-friendly access to ParseResult or a typed accessor
This would live as an additive helper, so no breaking change.
Would you consider such an addition?
I’m happy to draft a PR if the idea fits the roadmap.
Thanks!
dodexahedron and chrisc-onaorg
Metadata
Metadata
Assignees
Labels
No labels