Skip to content

make the non-generic Option and Argument ctors non-private#2624

Merged
jonsequitur merged 1 commit intodotnet:mainfrom
jonsequitur:make-Option-and-Argument-protected
Jul 8, 2025
Merged

make the non-generic Option and Argument ctors non-private#2624
jonsequitur merged 1 commit intodotnet:mainfrom
jonsequitur:make-Option-and-Argument-protected

Conversation

@jonsequitur
Copy link
Copy Markdown
Contributor

This allows these untyped Option and Argument classes to be inherited in code referencing System.CommandLine. This pattern was used by HelpOption and VersionOption in order to implement flag-style option behavior (with zero arity and no parseable return types). This same capability is useful beyond the scope of System.CommandLine's internals.

@jonsequitur jonsequitur enabled auto-merge (rebase) July 8, 2025 20:18
@jonsequitur jonsequitur merged commit 0c37e9e into dotnet:main Jul 8, 2025
10 checks passed
@anowarulbb
Copy link
Copy Markdown

src/System.CommandLine/Option{T}.cs

1 similar comment
@anowarulbb
Copy link
Copy Markdown

src/System.CommandLine/Option{T}.cs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants