First Check
Commit to Help
Example Code
from typing import Optional
import typer
app = typer.Typer()
@app.command()
def hello_test(name: Optional[str] = None):
if name:
typer.echo(f"Hello {name}")
else:
typer.echo("Hello World!")
if __name__ == "__main__":
app()
Description
expect: python main.py hello_test --name world
actually: python main.py hello-test --name world
I found the "_" in command name is replaced with "-".
source code https://github.com/tiangolo/typer/blob/master/typer/main.py#L390
why do this?
Thank u
Operating System
macOS
Operating System Details
No response
Typer Version
0.4.0
Python Version
3.9.7
Additional Context
No response
First Check
Commit to Help
Example Code
Description
expect:
python main.py hello_test --name worldactually:
python main.py hello-test --name worldI found the "_" in command name is replaced with "-".
source code https://github.com/tiangolo/typer/blob/master/typer/main.py#L390
why do this?
Thank u
Operating System
macOS
Operating System Details
No response
Typer Version
0.4.0
Python Version
3.9.7
Additional Context
No response