def  main( argv ):
global output_dir<EOL>try:<EOL><INDENT>opts, args = getopt.getopt( sys.argv[<NUM_LIT:1>:],"<STR_LIT>",["<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>"] )<EOL><DEDENT>except getopt.GetoptError:<EOL><INDENT>usage()<EOL>sys.exit( <NUM_LIT:2> )<EOL><DEDENT>if args == []:<EOL><INDENT>usage()<EOL>sys.exit( <NUM_LIT:1> )<EOL><DEDENT>project_title  = "<STR_LIT>"<EOL>project_prefix = None<EOL>output_dir     = None<EOL>for opt in opts:<EOL><INDENT>if opt[<NUM_LIT:0>] in ( "<STR_LIT>", "<STR_LIT>" ):<EOL><INDENT>usage()<EOL>sys.exit( <NUM_LIT:0> )<EOL><DEDENT>if opt[<NUM_LIT:0>] in ( "<STR_LIT>", "<STR_LIT>" ):<EOL><INDENT>project_title = opt[<NUM_LIT:1>]<EOL><DEDENT>if opt[<NUM_LIT:0>] in ( "<STR_LIT>", "<STR_LIT>" ):<EOL><INDENT>utils.output_dir = opt[<NUM_LIT:1>]<EOL><DEDENT>if opt[<NUM_LIT:0>] in ( "<STR_LIT>", "<STR_LIT>" ):<EOL><INDENT>project_prefix = opt[<NUM_LIT:1>]<EOL><DEDENT><DEDENT>check_output()<EOL>source_processor  = SourceProcessor()<EOL>content_processor = ContentProcessor()<EOL>file_list = make_file_list( args )<EOL>for filename in file_list:<EOL><INDENT>source_processor.parse_file( filename )<EOL>content_processor.parse_sources( source_processor )<EOL><DEDENT>content_processor.finish()<EOL>formatter = HtmlFormatter( content_processor, project_title, project_prefix )<EOL>formatter.toc_dump()<EOL>formatter.index_dump()<EOL>formatter.section_dump_all()<EOL>
main program loop