def replace_dashes(options):
    """Recursively replace dashes by underscores in dictonary keys."""
    if not isinstance(options, dict):
        return options
    return {
        option.replace('-', '_'): replace_dashes(value)
        for option, value in options.items()
    }