def parseargs(argv):
args = []<EOL>options = {}<EOL>key = None<EOL>for arg in argv:<EOL><INDENT>if arg in DEFAULT_OPTION_VALUES:<EOL><INDENT>key = arg.strip('<STR_LIT:=>').replace('<STR_LIT:->', '<STR_LIT:_>')<EOL>options[key] = ()<EOL><DEDENT>elif key is None:<EOL><INDENT>args.append(arg)<EOL><DEDENT>else:<EOL><INDENT>options[key] += (arg,)<EOL><DEDENT><DEDENT>if set(args) & {'<STR_LIT>', '<STR_LIT>'}:<EOL><INDENT>print(__doc__, end='<STR_LIT>')<EOL>exit(<NUM_LIT:0>)<EOL><DEDENT>elif set(args) & {'<STR_LIT>', '<STR_LIT>'}:<EOL><INDENT>print(__version__)<EOL>exit(<NUM_LIT:0>)<EOL><DEDENT>elif args:<EOL><INDENT>exit('<STR_LIT>' % args[<NUM_LIT:0>])<EOL><DEDENT>return options<EOL>
handle --help, --version and our double-equal ==options