def get_rename_name(ctx, args, incomplete):
    """
    Function to return all projects or tasks matching the prefix

    Depending on the specified rename_type, either a list of projects or a list
    of tasks must be returned. This function takes care of this distinction and
    returns the appropriate names.

    If the passed in type is unknown, e.g. due to a typo, an empty completion
    is generated.
    """

    in_type = ctx.params["rename_type"]
    if in_type == "project":
        return get_projects(ctx, args, incomplete)
    elif in_type == "tag":
        return get_tags(ctx, args, incomplete)

    return []

    Function to return all projects or tasks matching the prefix

    Depending on the specified rename_type, either a list of projects or a list
    of tasks must be returned. This function takes care of this distinction and
    returns the appropriate names.

    If the passed in type is unknown, e.g. due to a typo, an empty completion
    is generated.
    
watson/autocompletion.py