from typing import List
from typing import Dict


def convert_parser_arguments_to_key_value(parameters: List[str]) -> Dict[str, str]:
    """Converts a list of parameters passed to `ArgumentParser` into a dictionary.

    `parser.parse_args` will convert a series of arguments like:

    `sonar.py -p key1=value1 -p key2=value2`

    Into a list with each one of the entries as strings:

    `["key1=value1", "key2=value2"]`

    This function will convert this List into a Dict of (key, value).

    >>> convert_parser_arguments_to_key_value(["a=1", "b=2"])
    {"a": "1", "b": "2"}
    """
    if parameters is None:
        return {}

    d = {}

    for p in parameters:
        entry = p[0].split("=")
        d[entry[0]] = entry[1]

    return d