def main(args, prog_name):
<EOL>ui = getUI(args, prog_name)<EOL>if ui.optionIsSet("<STR_LIT:test>"):<EOL><INDENT>unittest.main(argv=[sys.argv[<NUM_LIT:0>]])<EOL><DEDENT>elif ui.optionIsSet("<STR_LIT>"):<EOL><INDENT>ui.usage()<EOL><DEDENT>else:<EOL><INDENT>verbose = (ui.optionIsSet("<STR_LIT>") is True) or DEFAULT_VERBOSITY<EOL>stranded = ui.optionIsSet("<STR_LIT>")<EOL>names = ui.optionIsSet("<STR_LIT>")<EOL>exact = ui.optionIsSet("<STR_LIT>")<EOL>out_fh = sys.stdout<EOL>if ui.optionIsSet("<STR_LIT>"):<EOL><INDENT>out_fh = open(ui.getValue("<STR_LIT>"), "<STR_LIT:w>")<EOL><DEDENT>in_fh = sys.stdin<EOL>if ui.hasArgument(<NUM_LIT:0>):<EOL><INDENT>in_fh = open(ui.getArgument(<NUM_LIT:0>))<EOL><DEDENT>regions = [x for x in BEDIterator(in_fh, verbose)]<EOL>if exact:<EOL><INDENT>collapse_exact(regions, stranded, names, out_fh)<EOL><DEDENT>else:<EOL><INDENT>for x in collapseRegions(regions, stranded, names, verbose):<EOL><INDENT>out_fh.write(str(x) + "<STR_LIT:\n>")<EOL><DEDENT><DEDENT><DEDENT>
main entry point for the script.

:param args: the arguments for this script, as a list of string. Should
             already have had things like the script name stripped. That
             is, if there are no args provided, this should be an empty
             list.