Skip to content

Conversation

@gewarren
Copy link
Contributor

@gewarren gewarren commented Dec 6, 2025

Fixes #50368

Th previous code throws a runtime exception due to the breaking change noted in the second paragraph here.


Internal previews

📄 File 🔗 Preview link
docs/standard/commandline/how-to-parse-and-invoke.md Parsing and invocation in System.CommandLine
@gewarren gewarren requested a review from a team as a code owner December 6, 2025 03:28
Copilot AI review requested due to automatic review settings December 6, 2025 03:28
@dotnetrepoman dotnetrepoman bot added this to the December 2025 milestone Dec 6, 2025
@gewarren gewarren enabled auto-merge (squash) December 6, 2025 03:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses issue #50368 by updating code to comply with breaking changes introduced in System.CommandLine 2.0.0-beta5, specifically related to option construction syntax.

  • Updates the Option<T> constructor usage to use object initializer syntax for setting the Description property, as the two-parameter constructor accepting description is no longer supported.
  • Modernizes API references in documentation by correcting namespaces (e.g., System.CommandLine.ParseResult instead of System.CommandLine.Parsing.ParseResult) and adding proper cross-references.
  • Improves documentation formatting by adding code-style backticks to type names in headings, consistent with .NET documentation standards.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
docs/standard/commandline/snippets/handle-termination/csharp/Program.cs Updates option construction to use object initializer syntax for Description property instead of constructor parameter.
docs/standard/commandline/how-to-parse-and-invoke.md Corrects API namespaces, adds proper xref links for types and methods, improves code formatting in headings, and simplifies inline method references for better readability.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM @gewarren

Let's :shipit:

@gewarren gewarren merged commit ffd3d7f into dotnet:main Dec 8, 2025
9 checks passed
@gewarren gewarren deleted the not-alias branch December 8, 2025 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants