def ctl(ctx: click.Context, config_file: str, dcs_url: Optional[str], insecure: bool) -> None:
    """Command-line interface for interacting with Patroni.
    \f
    Entry point of ``patronictl`` utility.

    Load the configuration file.

    .. note::
        Besides *dcs_url* and *insecure*, which are used to override DCS configuration section and ``ctl.insecure``
        setting, you can also override the value of ``log.level``, by default ``WARNING``, through either of these
        environment variables:
            * ``LOGLEVEL``
            * ``PATRONI_LOGLEVEL``
            * ``PATRONI_LOG_LEVEL``

    :param ctx: click context to be passed to sub-commands.
    :param config_file: path to the configuration file.
    :param dcs_url: the DCS URL in the format ``DCS://HOST:PORT``, e.g. ``etcd3://random.com:2399``. If given override
        whatever DCS is set in the configuration file.
    :param insecure: if ``True`` allow SSL connections without client certificates. Override what is configured through
        ``ctl.insecure` in the configuration file.
    """
    level = 'WARNING'
    for name in ('LOGLEVEL', 'PATRONI_LOGLEVEL', 'PATRONI_LOG_LEVEL'):
        level = os.environ.get(name, level)
    logging.basicConfig(format='%(asctime)s - %(levelname)s - %(message)s', level=level)
    logging.captureWarnings(True)  # Capture eventual SSL warning
    config = load_config(config_file, dcs_url)
    # backward compatibility for configuration file where ctl section is not defined
    config.setdefault('ctl', {})['insecure'] = config.get('ctl', {}).get('insecure') or insecure
    ctx.obj = {'__config': config, '__mpp': get_mpp(config)}
Command-line interface for interacting with Patroni.
    
    Entry point of ``patronictl`` utility.

    Load the configuration file.

    .. note::
        Besides *dcs_url* and *insecure*, which are used to override DCS configuration section and ``ctl.insecure``
        setting, you can also override the value of ``log.level``, by default ``WARNING``, through either of these
        environment variables:
            * ``LOGLEVEL``
            * ``PATRONI_LOGLEVEL``
            * ``PATRONI_LOG_LEVEL``

    :param ctx: click context to be passed to sub-commands.
    :param config_file: path to the configuration file.
    :param dcs_url: the DCS URL in the format ``DCS://HOST:PORT``, e.g. ``etcd3://random.com:2399``. If given override
        whatever DCS is set in the configuration file.
    :param insecure: if ``True`` allow SSL connections without client certificates. Override what is configured through
        ``ctl.insecure` in the configuration file.
    
patroni/ctl.py