TV Programs
TV Programs can also be defined in Python files that implement an Argparse ArgumentParser
.
For example, to define a TV Program for the echo
command:
echo.py
import argparse
parser = argparse.ArgumentParser(prog="echo", description="Print text.")
parser.add_argument("message", nargs="+")
parser.add_argument("-n", action="store_true", help="no trailing newline")
Execute the program file with tv
:
$ tv echo.py -n Hello World