You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
System.CommandLine already supports global options, but there’s no sample showing
how to define a global --verbosity (-v) option that applies to all subcommands
and defaults to Diagnostic when specified without a value.
Suggested improvement
Add a short example to the README or samples folder demonstrating:
varverbosity=newOption<string>(new[]{"-v","--verbosity"},"Set output verbosity (quiet, minimal, normal, detailed, diagnostic)"){Arity=ArgumentArity.ZeroOrOne};root.AddGlobalOption(verbosity);Whythis helps
--verbosityisastandard.NET CLI pattern,soshowing how to implement it helps developers align their own tools with.NET conventions.