def parse_filename(filename: str, pat: str) -> str:
    """generates output filename with pattern addition

    Args:
        filename (str): file to process
        pat (str): pattern to add

    Returns:
        str: generated filename
    """

    # very naive implementation
    idx = filename.rfind(".")

    name = filename[:idx]
    ext = filename[idx:]

    out = f"{name}-{pat}{ext}"

    return out