Skip to content

version_callback

faststream.cli.main.version_callback #

version_callback(version: bool) -> None

Callback function for displaying version information.

PARAMETER DESCRIPTION
version

If True, display version information

TYPE: bool

RETURNS DESCRIPTION
None

None

Source code in faststream/cli/main.py
def version_callback(version: bool) -> None:
    """Callback function for displaying version information.

    Args:
        version: If True, display version information

    Returns:
        None
    """
    if version is True:
        import platform

        typer.echo(
            "Running FastStream {} with {} {} on {}".format(
                __version__,
                platform.python_implementation(),
                platform.python_version(),
                platform.system(),
            )
        )

        raise typer.Exit()