-
-
Notifications
You must be signed in to change notification settings - Fork 779
Closed as duplicate of#1156
Labels
questionQuestion or problemQuestion or problem
Description
First Check
- I added a very descriptive title to this issue.
- I used the GitHub search to find a similar issue and didn't find it.
- I searched the Typer documentation, with the integrated search.
- I already searched in Google "How to X in Typer" and didn't find any information.
- I already read and followed all the tutorial in the docs and didn't find an answer.
- I already checked if it is not related to Typer but to Click.
Commit to Help
- I commit to help with one of those options 👆
Example Code
import typer
from typing import Optional
def main(name: Optional[str] = typer.Argument(None)):
if name:
typer.echo(f'Name: {name}')
if __name__ == '__main__':
typer.run(main)
Description
For optional arguments Typer shows their metavar instead of type in argument help. For above example instead of TEXT
we get [NAME]
in argument help.
Operating System
macOS
Operating System Details
No response
Typer Version
0.6.1
Python Version
3.10
Additional Context
No response
YuriiMotov
Metadata
Metadata
Assignees
Labels
questionQuestion or problemQuestion or problem