fix: hide INTEGER from help for count=True options (closes #1869)#1871
Open
pooyanazad wants to merge 2 commits into
Open
fix: hide INTEGER from help for count=True options (closes #1869)#1871pooyanazad wants to merge 2 commits into
pooyanazad wants to merge 2 commits into
Conversation
Author
|
Hi! Could someone please add the bug label so the CI checks can pass? Thanks! |
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: #1869
Description
Fixed #1869 —
count=Trueoptions were incorrectly showingINTEGERin the help text, making it look like they take a value (e.g.--verbose 3), when they actually work as flag-like counters (e.g.--verbose --verbose).Two small changes:
typer/core.py:TyperOption.make_metavar()now returns""forcount=Trueoptions, matching how Click handles count internally.typer/rich_utils.py:_print_options_panel()now skips appending the type name (e.g.INTEGER RANGE) for count options.Before:
--verbose INTEGER [default: 0]After:
--verbose [default: 0]AI Disclaimer
Review with Claude Opus 4.6
Checklist
*Coverage note:
test_others.py::test_atomic_write_examplehas a pre-existing failure unrelated to this change. All other tests pass (38/38 intest_core.pyandtest_rich_utils.py).