def get_debug_option_value(curr_value, options, option_name):
    """Common handling of debug options.
    - If the current value is truthy, then ignore the option value  All
    current values should default to falsy, so they will only be truthy
    when someone is debugging the plugin code
    - If the requested option name isn't in the options, then use the default
    (aka current) value.
    :param  curr_value  Initial value of option
    :param  options     Dictionary of options passed in from coverage.py
    :param  option_name Key name of option in 'options' dict
    :returns option value
    """
    value = options.get(option_name, curr_value)
    if isinstance(value, str):
        v = value.lower()
        if v in ('f', 'false', 'no', 'n', 0):
            value = False
        elif v in ('t', 'true', 'yes', 'y', 1):
            value = True
    return value
