def _boolean_or_list(config_name, args, configs, alternative_names=[],
    default=[]):
    """Get a boolean or list of regexes from args and configs."""
    for key in (alternative_names + [config_name]):
        if hasattr(args, key) and getattr(args, key):
            setattr(args, config_name, ['.*'])
            return
    setattr(args, config_name, default)
    option = None
    alternative_names.insert(0, config_name)
    for key in alternative_names:
        if configs.has_option('settings', key):
            option = configs.get('settings', key)
            break
    if option is not None:
        if option.strip().lower() == 'true':
            setattr(args, config_name, ['.*'])
        elif option.strip().lower() == 'false':
            setattr(args, config_name, [])
        else:
            for pattern in option.split('\n'):
                if pattern.strip() != '':
                    if not getattr(args, config_name):
                        setattr(args, config_name, [])
                    getattr(args, config_name).append(pattern)
