Skip to content

Return a success exit code for --version - #724

Merged
tannergooding merged 1 commit into
dotnet:mainfrom
tannergooding:cli-version-exit-code
Jul 13, 2026
Merged

Return a success exit code for --version#724
tannergooding merged 1 commit into
dotnet:mainfrom
tannergooding:cli-version-exit-code

Conversation

@tannergooding

Copy link
Copy Markdown
Member

The --version handler printed the version banner and then set context.ExitCode = -1, copied from the surrounding argument-error return paths. --version is an informational request that completed successfully, so it should exit 0 -- matching the convention of clang --version and dotnet --version, and avoiding a spurious failure signal for anything that shells out to query the version.

Note

This PR description was drafted by Copilot on my behalf.

The --version handler printed the version info and then set an exit code of -1, copied from the argument-error return paths. Version is an informational request, so it should exit 0 to match the convention of clang --version and dotnet --version.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@tannergooding
tannergooding merged commit eae704d into dotnet:main Jul 13, 2026
14 checks passed
@tannergooding
tannergooding deleted the cli-version-exit-code branch July 13, 2026 04:30
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.

1 participant