def get_param_value(name, params1, params2=[], params3=[]):
    """
    Searches for the given param name in given arrays and returns the value of the first occurrence. The param name must
    match completely, so you have to pass it along with "-D" if it is in the arrays.
    """
    for params in [params1, params2, params3]:
        for param in params:
            if param.startswith(name + "="):
                return param.replace(name + "=", "")
    return None