cookiecutter-wuttaweb/{{ cookiecutter.repo_name }}/{{ cookiecutter.package_name }}/cli.py
Lance Edgar 46b33a622f initial template for app based on wuttaweb
with e.g. `poser install` command
2024-11-26 11:16:09 -06:00

31 lines
871 B
Python

# -*- coding: utf-8; -*-
"""
{{cookiecutter.project_name}} CLI
"""
import typer
from wuttjamaican.cli import make_typer
{{cookiecutter.package_name}}_typer = make_typer(
name='{{cookiecutter.package_name}}',
help="{{cookiecutter.project_name}} -- {{cookiecutter.project_short_description}}"
)
@{{cookiecutter.package_name}}_typer.command()
def install(
ctx: typer.Context,
):
"""
Install the {{cookiecutter.project_name}} app
"""
config = ctx.parent.wutta_config
app = config.get_app()
install = app.get_install_handler(pkg_name='{{cookiecutter.package_name}}',
app_title="{{cookiecutter.project_name}}",
pypi_name='{{cookiecutter.distribution_name}}',
egg_name='{{cookiecutter.__egg_name}}')
install.run()