def list_to_choices(l, sort=True):
    """Converts a list of strings to the proper PyInquirer 'choice' format
    
    Args:
        l (list): a list of str values
        sort (bool, optional): Defaults to True. Whether or not the choices
            should be sorted alphabetically.
    
    Returns:
        list: a list of dicts in questionary format
    """
    if sort:
        l = sorted(l)
    choices = []
    for item in l:
        choices.append({"name": item})
    return choices