jeeves
package instead of jeeves.py
file
Instead of Jeeves.py file, a Python package named jeeves
can also be used.
- That helps to structure code better if you have multiple commands,
- You no longer need to make sub-commands hidden.
jeeves/__init__.py
from jeeves.lint import lint
from jeeves.test import test
jeeves/test.py
import typer
test = typer.Typer()
@test.command()
def unit():
"""Run unit tests."""
@test.command()
def integration():
"""Run integration tests."""
jeeves/lint.py
import typer
lint = typer.Typer(no_args_is_help=True)
@lint.command()
def mypy():
"""Run mypy."""
@lint.command()
def flake8():
"""Run flake8."""
print(flake8.__doc__)
Top level documentation
โฆ
j
Usage: j [OPTIONS] COMMAND [ARGS]...
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --log-level [debug|info|error] Logging level. โ
โ [default: LogLevel.ERROR] โ
โ --install-completion Install completion for the โ
โ current shell. โ
โ --show-completion Show completion for the โ
โ current shell, to copy it or โ
โ customize the installation. โ
โ --help Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Commands โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ lint โ
โ test โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Command documentation
โฆ
j lint
Usage: j lint [OPTIONS] COMMAND [ARGS]...
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --help Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Commands โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ flake8 Run flake8. โ
โ mypy Run mypy. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Sub command documentation
โฆ
j lint flake8 --help
Usage: j lint flake8 [OPTIONS]
Run flake8.
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --help Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โฆand execution
โฆ
j lint flake8
Run flake8.