()
| 153 | |
| 154 | |
| 155 | def main(): |
| 156 | p = argparse.ArgumentParser(description="Extracts identifier data from a Teeworlds source file and its header, outputting the data as CSV to stdout") |
| 157 | p.add_argument("file", metavar="FILE", nargs="+", help="Source file to analyze") |
| 158 | p.add_argument("--break-on", help="Break on a specific variable name, useful to debug issues with the script") |
| 159 | args = p.parse_args() |
| 160 | |
| 161 | extra_args = [] |
| 162 | if "CXXFLAGS" in os.environ: |
| 163 | extra_args = os.environ["CXXFLAGS"].split() |
| 164 | |
| 165 | out = csv.DictWriter(sys.stdout, "file line column kind path qualifiers type name".split()) |
| 166 | out.writeheader() |
| 167 | files = args.file |
| 168 | if len(files) > 1: |
| 169 | files = tqdm(files, leave=False) |
| 170 | error = False |
| 171 | for file in files: |
| 172 | try: |
| 173 | process_source_file(out, file, extra_args, args.break_on) |
| 174 | except ParseError: |
| 175 | error = True |
| 176 | return int(error) |
| 177 | |
| 178 | |
| 179 | if __name__ == "__main__": |
no test coverage detected