def force_console_input(
    query: str,
    allowable,
    onfail: str = "Input not recognised, please try again.\n",
    case_sensitive=False,
):
    """Get an input from the user matching some string in allowable.

    Args:
        query (str): The query to issue the user with.
        allowable (str or container): The options which the user is allowed to submit.
            If this is a string, acceptable answers will be substrings.
            For containers acceptable answers will be elements of the container.
    
    Returns:
        The correct input returned
    
    Raises:
        IOError: A request to quit was submitted.
    """
    if not allowable:
        raise ValueError("At least one entry must be allowable.")

    submission = input(query)
    while True:
        if not case_sensitive:
            submission = submission.lower()

        if submission in ("quit", "exit"):
            raise IOError("Exit command received.")
        if submission in allowable:
            return submission

        submission = input(onfail)