def validate_names(names: list, name: str, command: str):
    """
    Simple function to validate existence of name within names list.

    Args:
        names (list): selected index
        name (str): name
        command (str): name of command for "tailored" help message
    """

    if name not in names:
        raise IndexError(f"{command} {name} does not exist... Run `kaos {command} list` again")
    return name