from typing import Union


def limited_input(dont_bother: bool) -> Union[bool, str]:
    """Prompt for cli input with limited options: y, n, d(dont bother me).

    Returns
    -------
    Union[bool, str]
        can be True, False or d for dont bother
    """
    while True:
        if dont_bother:
            inpt = input("Do you want to proceed? [y(yes), n(no), "
                         "d(don't bother me again)]")
        else:
            inpt = input("Do you want to proceed? [y(yes), n(no)]: ")

        inpt = str(inpt).strip().casefold()

        if not inpt or inpt == "y":
            return True
        elif inpt == "n":
            return False
        elif inpt == "d" and dont_bother:
            return "d"
        else:
            if dont_bother:
                print("You must input 'y', 'n' or 'd'")
            else:
                print("You must input 'y' or 'n'")