def _merge_setting(cli_options, conf, name, name_cli=None, default=None):
    """Merge a setting, preferring the CLI option if set
    :param dict cli_options: cli options
    :param dict conf: configuration sub-block
    :param str name: key name
    :param str name_cli: override key name for cli_options
    :param Any default: default value to set if missing
    :rtype: Any
    :return: merged setting value
    """
    val = cli_options.get(name_cli or name)
    if val is None:
        val = conf.get(name, default)
    return val
