import fnmatch


def get_file_line_number_with_content(
    file, content, strip=False, match=False, encoding="utf-8"
):
    """
    Get a file line number that has a content.

    The lines can be stripped before check using strip parameter.

    The fnmatch function can be used to check using match parameter.

    Arguments:
        file : str

        content : str

        strip : bool

        match: bool

    Returns:
        int
    """

    with open(file, encoding=encoding) as f:
        lines = f.readlines()

        result = None

        for line_number, line in enumerate(lines):
            if strip:
                line = line.strip()

            if match:
                if fnmatch.fnmatch(line, content):
                    result = line_number + 1
                    break

            else:
                if line == content:
                    result = line_number + 1
                    break

        f.close()

        return result