Skip to content

Commit

Permalink
feat: Add support for Typer
Browse files Browse the repository at this point in the history
  • Loading branch information
evanmags committed May 22, 2023
1 parent b9ddd90 commit 7430cb1
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 44 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ pip install trogon

## Quickstart

### Click
1. Import `from trogon import tui`
2. Add the `@tui` decorator above your click app. e.g.
```python
Expand All @@ -100,6 +101,15 @@ pip install trogon
```
3. Your click app will have a new `tui` command available.

### Typer
1. Import `from trogon import tui`
2. Add the `tui` decorator above your typer app. e.g.
```python
cli = Typer(...)
cli = tui()(cli)
```
3. Your click app will have a new `tui` command available.

See also the `examples` folder for two example apps.

## Follow this project
Expand Down
67 changes: 26 additions & 41 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ textual = {version = ">=0.26.0"}
#textual = {extras = ["dev"], path = "../textual", develop = true}
click = ">=8.0.0"

[tool.poetry.extras]
typer = ["typer=^0.9.0"]


[tool.poetry.group.dev.dependencies]
mypy = "^1.2.0"
Expand Down
Empty file added trogon/_.py
Empty file.
Loading

0 comments on commit 7430cb1

Please sign in to comment.