Skip to content

Commit

Permalink
Add Typer example
Browse files Browse the repository at this point in the history
Resolves #94
  • Loading branch information
daneah committed Nov 16, 2024
1 parent 1d10d9f commit 2bc0013
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions examples/typer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from typing import Annotated

import typer
from trogon.typer import init_tui


app = typer.Typer()


@app.command()
def hello(name: Annotated[str, typer.Argument(help="The person to greet")]):
typer.echo(f"Hello, {name}!")


init_tui(app)


if __name__ == "__main__":
app()

0 comments on commit 2bc0013

Please sign in to comment.