metavar option has no effect when used with parser option if metavar set is the one generated without parser #1254
Unanswered
ArthurGarnier
asked this question in
Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
When setting a parser to an Argument (or an Option) the metavar is replaced by the parser function name, in the above submitted snippet, if I don't set metavar, the metavar is automatically changed to _FOO in --help :
Maybe this is a root cause of the below issue.
So a workaroung to set a proper metavar is to set metavar="NAME", but by doing this, the metavar is not changed in the help output and stays at "_FOO" instead of "NAME". If I set anything else than "NAME", even "NAMe" it works as expected.
Operating System
Linux
Operating System Details
No response
Typer Version
0.16.0
Python Version
3.12.11
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions