def _extract_options(args, parameterized=[]):
    """
    Parse command-line arguments, removing options prefixed by "--" from the
    given list and returning them as a dictionary.
    """
    options = {}
    while len(args) > 1 and args[1].startswith('--'):
        option = args.pop(1)[2:]
        if option in parameterized:
            options[option] = args.pop(1)
        else:
            options[option] = None
    return options
