Skip to content

Main

elva.main

Module with the entry point for the elva command.

Subcommands are defined in the respective app package.

Functions:

  • elva

    ELVA - A suite of real-time collaboration TUI apps.

  • context

    Print the parameters passed to apps and other subcommands.

elva()

ELVA - A suite of real-time collaboration TUI apps.

Source code in src/elva/main.py
@click.group()
@click.version_option(prog_name=APP_NAME)
def elva():
    """
    ELVA - A suite of real-time collaboration TUI apps.
    """
    return

context(config, *args, **kwargs)

Print the parameters passed to apps and other subcommands.

This command stringifies all parameter values for the TOML serializer.

Parameters:

  • config (dict) –

    mapping of merged configuration parameters from various sources.

  • *args (tuple, default: () ) –

    additional positional arguments as container for passed CLI parameters.

  • **kwargs (dict, default: {} ) –

    additional keyword arguments as container for passed CLI parameters.

Source code in src/elva/main.py
@elva.command
@common_options
@click.option(
    "--app",
    "app",
    metavar="APP",
    help="Include the parameters defined in the [APP] config file table.",
)
@file_paths_option_and_argument
@pass_config
def context(config: dict, *args: tuple, **kwargs: dict):
    """
    Print the parameters passed to apps and other subcommands.
    \f

    This command stringifies all parameter values for the TOML serializer.

    Arguments:
        config: mapping of merged configuration parameters from various sources.
        *args: additional positional arguments as container for passed CLI parameters.
        **kwargs: additional keyword arguments as container for passed CLI parameters.
    """
    # convert all non-string objects to strings
    if config.get("configs"):
        config["configs"] = [str(path) for path in config["configs"]]

    for param in ("file", "log", "render", "password"):
        if config.get(param):
            config[param] = str(config[param])

    click.echo(tomli_w.dumps(config))