def _parse_arguments(argstring):
    """
    Parses argstring from nginx -V

    :param argstring: configure string
    :return: {} of parsed string
    """
    arguments = {}

    current_key = None
    current_value = None

    for part in argstring.split(' --'):
        if '=' in part:
            # next part of compound
            if current_key and current_value:
                current_value += part
                if part.endswith("'"):
                    arguments[current_key] = current_value
                    current_key = None
                    current_value = None
            else:
                k, v = part.split('=', 1)
                # compound argument
                if v.startswith("'") and v.endswith("'"):
                    arguments[k] = v
                elif v.startswith("'"):
                    current_key = k
                    current_value = v
                # simple argument
                else:
                    arguments[k] = v
        else:
            # boolean
            if part:
                arguments[part] = True

    return arguments