First Check
Commit to Help
Example Code
import typer
app = typer.Typer()
# currently required options look like this:
@app.command()
def main(
username: str = typer.Option(..., help="A Username")
):
<code>
Description
Please make typer.Option required arguments conform to a more readable syntax than ellipsis.
From the function param:
username: str = typer.Option(..., help="A Username")
unless you have working knowledge of this library you wouldn't be able to know if:
- the default value for username is ellipsis
- would be confused why the default value doesnt form to the type
str
- would probably not know without inspecing typer.Option's signature that the first argument is a default value
- would not know that an ellipsis as a default would invoke additional option logic
Please consider moving this feature to a kwarg in typer.Option.
Wanted Solution
typer.Option supports a new kwarg: required: bool
Wanted Code
import typer
app = typer.Typer()
# This is a more expressive and readable
@app.command()
def main(
username: str = typer.Option("", help="A Username", required=True)
):
<code>
Alternatives
N/A
Operating System
Linux
Operating System Details
No response
Typer Version
0.4.0
Python Version
3.9+
Additional Context
No response
First Check
Commit to Help
Example Code
Description
Please make typer.Option required arguments conform to a more readable syntax than ellipsis.
From the function param:
username: str = typer.Option(..., help="A Username")unless you have working knowledge of this library you wouldn't be able to know if:
strPlease consider moving this feature to a kwarg in typer.Option.
Wanted Solution
typer.Option supports a new kwarg: required: bool
Wanted Code
Alternatives
N/A
Operating System
Linux
Operating System Details
No response
Typer Version
0.4.0
Python Version
3.9+
Additional Context
No response