Conversation
svlandeg
commented
Sep 14, 2026
| "--arg6", | ||
| "6", | ||
| "--ARG9", | ||
| "--arg9", |
Member
Author
There was a problem hiding this comment.
I actually think this was the originally intended behaviour of the test, as the print-out on L399 has arg9, not ARG9 (while ARG4 upper-cased does make sense)
svlandeg
marked this pull request as ready for review
September 14, 2026 15:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Discussion: #1900
Description
Metavar annotations aren't supposed to influence the display/usage of the option name, as demonstrated by the test
test_parameter_metavarwhich ensures thatname: Annotated[str, typer.Option(metavar="CUSTOM")is called with--name.A recent PR #1863 (released with 0.27.0) introduced a small regression on this behaviour, where a metavar corresponding to the option name (if both were lower-cased) could actually overwrite the casing. In retrospect, and after studying the reports & arguments in #1900, I think this was a bug/mistake on my end.
This PR fixes things to make the rule consistent: metavars are only for display (as already documented) and should never influence how an option is used.
0.27.0(while being less breaking with the original
0.26.8behaviour)AI Disclaimer
Used Cursor as a sparring partner to check my understanding & reasoning, we agreed on all edits in this PR 馃檪
Checklist