def METHOD_NAME(
    settings_obj,
    *,
    compact: bool,
    verbose: bool,
    show_secrets: bool,
    **pydantic_export_options,
):
    exclude_unset = pydantic_export_options.get("exclude_unset", False)
    for field in settings_obj.__fields__.values():
        auto_default_from_env = field.field_info.extra.get(
            "auto_default_from_env", False
        )
        value = getattr(settings_obj, field.name)
        if exclude_unset and field.name not in settings_obj.__fields_set__:
            if not auto_default_from_env:
                continue
            if value is None:
                continue
        if isinstance(value, BaseSettings):
            if compact:
                value = f"'{value.json(**pydantic_export_options)}'"  # flat
            else:
                if verbose:
                    typer.echo(f"\n# --- {field.name} --- ")
                METHOD_NAME(
                    value,
                    compact=False,
                    verbose=verbose,
                    show_secrets=show_secrets,
                    **pydantic_export_options,
                )
                continue
        elif show_secrets and hasattr(value, "get_secret_value"):
            value = value.get_secret_value()
        if verbose:
            field_info = field.field_info
            if field_info.description:
                typer.echo(f"# {field_info.description}")
        typer.echo(f"{field.name}={value}")