Skip to content

cli_app.cli.callbacks.meta

cli_app.cli.callbacks.meta

authors_cb

authors_cb(v=False)

Show contacts of authors of the CLI.

Source code in src/cli_app/cli/callbacks/meta.py
def authors_cb(v: bool = False) -> None:
    """Show contacts of authors of the CLI."""
    if v:
        meta, console = get_project_meta(), get_console()

        authors = cast(list[ContactDict], meta["authors"])
        authors_strings = [
            f"{author['name']} <[bold]{author['email']}[/bold]>" for author in authors
        ]
        console.print("\n".join(authors_strings))

        raise Exit(0)

summary_cb

summary_cb(v=False)

Show the summary of the CLI.

Source code in src/cli_app/cli/callbacks/meta.py
def summary_cb(v: bool = False) -> None:
    """Show the summary of the CLI."""
    if v:
        meta, console = get_project_meta(), get_console()

        console.print(f"{meta['summary']}")

        raise Exit(0)

version_cb

version_cb(v=False)

Show the version of the CLI.

Source code in src/cli_app/cli/callbacks/meta.py
def version_cb(v: bool = False) -> None:
    """Show the version of the CLI."""
    if v:
        meta, console = get_project_meta(), get_console()

        version_str = f"[bold]{meta['name']} {meta['version']}[/bold]"
        dependencies = cast(list[DependencyDict], meta["dependencies"])
        deps_strs = [f" - {dep['name']} {dep['version']}" for dep in dependencies]
        console.print(
            version_str + "\n\nUses:\n" + "\n".join(deps_strs) if deps_strs else version_str
        )

        raise Exit(0)