| 1 |
import typer |
| 2 |
|
| 3 |
import cyclopts |
| 4 |
|
| 5 |
typer_app = typer.Typer() |
| 6 |
|
| 7 |
|
| 8 |
@typer_app.callback() |
| 9 |
def dummy(): |
| 10 |
|
| 11 |
pass |
| 12 |
|
| 13 |
|
| 14 |
@typer_app.command() |
| 15 |
def foo(bar): |
| 16 |
"""Foo Docstring. |
| 17 |
|
| 18 |
Parameters |
| 19 |
---------- |
| 20 |
bar: str |
| 21 |
Bar parameter docstring. |
| 22 |
""" |
| 23 |
pass |
| 24 |
|
| 25 |
|
| 26 |
print("Typer:") |
| 27 |
|
| 28 |
|
| 29 |
typer_app(["--help"], standalone_mode=False) |
| 30 |
─────────────────────────────────────╮ |
| 31 |
│ |
| 32 |
───────────────────────────────────────────╯ |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
typer_app(["foo", "--help"], standalone_mode=False) |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
────────────────────────────────────╮ |
| 41 |
│ |
| 42 |
───────────────────────────────────────────╯ |
| 43 |
|
| 44 |
cyclopts_app = cyclopts.App() |
| 45 |
|
| 46 |
|
| 47 |
@cyclopts_app.command() |
| 48 |
def foo(bar): |
| 49 |
"""Foo Docstring. |
| 50 |
|
| 51 |
Parameters |
| 52 |
---------- |
| 53 |
bar: str |
| 54 |
Bar parameter docstring. |
| 55 |
""" |
| 56 |
pass |
| 57 |
|
| 58 |
|
| 59 |
print("Cyclopts:") |
| 60 |
|
| 61 |
|
| 62 |
cyclopts_app(["--help"]) |
| 63 |
─────────────────────────────────────╮ |
| 64 |
│ |
| 65 |
───────────────────────────────────────────╯ |
| 66 |
cyclopts_app(["foo", "--help"]) |
| 67 |
|
| 68 |
|
| 69 |
───────────────────────────────────╮ |
| 70 |
│ |
| 71 |
───────────────────────────────────────────╯ |