def main(argv): #parse the command line parser = argparse.ArgumentParser(description="Generates the Code required to instrument ETW logging mechanism") required = parser.add_argument_group('required arguments') required.add_argument('--man', type=str, required=True, help='full path to manifest containig the description of events') required.add_argument('--exc', type=str, required=True, help='full path to exclusion list') required.add_argument('--intermediate', type=str, required=True, help='full path to eventprovider intermediate directory') args, unknown = parser.parse_known_args(argv) if unknown: print('Unknown argument(s): ', ', '.join(unknown)) return 1 manifest = args.man exclusion_filename = args.exc intermediate = args.intermediate checkConsistency(manifest, exclusion_filename) genFiles(manifest, intermediate, exclusion_filename) # Update the final directory from temp provider_temp_dirname = os.path.join(intermediate, etw_dirname + "_temp") provider_dirname = os.path.join(intermediate, etw_dirname) if not os.path.exists(provider_dirname): os.makedirs(provider_dirname) update_directory(provider_temp_dirname, provider_dirname) shutil.rmtree(provider_temp_dirname)