From 79f32b351b1883cf47cb9bab53d5b07ba05d5791 Mon Sep 17 00:00:00 2001 From: Christian Krinitsin Date: Tue, 8 Apr 2025 15:35:27 +0200 Subject: add output option --- create_report.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'create_report.py') diff --git a/create_report.py b/create_report.py index c70b094..b3c0e70 100644 --- a/create_report.py +++ b/create_report.py @@ -4,6 +4,7 @@ import argparse parser = argparse.ArgumentParser(prog='test_report_manager') parser.add_argument('executable', help="executable to parse") +parser.add_argument('-o', '--out', help="output file (default: report.html)", default="report.html") args = parser.parse_args() data, stats = parse_data(args.executable) @@ -16,7 +17,7 @@ template = env.get_template("template.html") html_output = template.render(data=data, stats=stats) # Save the generated HTML to a file -with open("report.html", "w", encoding="utf-8") as f: +with open(args.out, "w", encoding="utf-8") as f: f.write(html_output) -print("Report generated: report.html") \ No newline at end of file +print(f"Report generated: {args.out}") \ No newline at end of file -- cgit 1.4.1