about summary refs log tree commit diff stats
path: root/create_report.py
diff options
context:
space:
mode:
authorChristian Krinitsin <christian.krinitsin@iqmine.de>2025-04-08 15:35:27 +0200
committerChristian Krinitsin <christian.krinitsin@iqmine.de>2025-04-08 15:35:27 +0200
commit79f32b351b1883cf47cb9bab53d5b07ba05d5791 (patch)
tree212054390004ef79b30f37f596dac40819788c40 /create_report.py
parent07741cdf203e3a7e339ef0b65c43107ac83877f0 (diff)
downloadtestreport-79f32b351b1883cf47cb9bab53d5b07ba05d5791.tar.gz
testreport-79f32b351b1883cf47cb9bab53d5b07ba05d5791.zip
add output option
Diffstat (limited to 'create_report.py')
-rw-r--r--create_report.py5
1 files changed, 3 insertions, 2 deletions
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