def parse_options(args):
usage = '<STR_LIT>'<EOL>parser = OptionParser(usage=usage)<EOL>parser.add_option('<STR_LIT>', '<STR_LIT>', action='<STR_LIT:store>',<EOL>type='<STR_LIT:int>', dest='<STR_LIT>',<EOL>help='<STR_LIT>')<EOL>parser.add_option('<STR_LIT>', '<STR_LIT>', action='<STR_LIT:store>',<EOL>type='<STR_LIT:string>', dest='<STR_LIT>',<EOL>help='<STR_LIT>')<EOL>options, argv = parser.parse_args(args)<EOL>if options.pagenum and options.pagename:<EOL><INDENT>parser.error('<STR_LIT>')<EOL><DEDENT>if len(argv) != <NUM_LIT:2>:<EOL><INDENT>parser.print_usage(sys.stderr)<EOL>parser.exit()<EOL><DEDENT>output_ext = os.path.splitext(argv[<NUM_LIT:1>])[<NUM_LIT:1>].lower()<EOL>if output_ext not in ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>parser.error('<STR_LIT>' % argv[<NUM_LIT:1>])<EOL><DEDENT>return options, argv<EOL>
Parses command line options