Example: invoke_tui()
Using invoke_tui()
, argparse serves as a declarative, domain-specific language (DSL) for building TUI forms for any CLI application.
echo.py
import argparse
from argparse_tui import invoke_tui
parser = argparse.ArgumentParser(prog="echo")
parser.add_argument("message", nargs="*")
invoke_tui(parser)
$ python echo.py hello world