def main(args=None):
    if args is None:
        args = sys.argv[1:]

    parser = argparse.ArgumentParser(prog=NAME,
                                     description=main.__doc__)
    parser.add_argument("-s", "--status", default="failed", required=False,
                        choices=["passed", "failed", "skipped"],
                        help="Status to select (passed, failed, skipped).")
    parser.add_argument("xml_file", nargs="*",
                        help="XML file(s) or directory with XML files.")
    parser.add_argument("--version", action="version", version=VERSION)

    options = parser.parse_args(args)

    xml_files = options.xml_file
    xml_reports = path_select_files(xml_files)
    for xml_filename in xml_reports:
        tree = ET.parse(xml_filename)
        testcases = xml_select_testcases_with_status(tree, options.status)
        if testcases:
            report_testcases(xml_filename, testcases)
    return 0
Filter JUnit XML reports to show only a subset of all information.
dataset/ETHPy150Open behave/behave/bin/behave.junit_filter.py/main