Skip to content

Commit

Permalink
Add output-file arg
Browse files Browse the repository at this point in the history
  • Loading branch information
0xdabbad00 committed Nov 8, 2021
1 parent 04bd2bf commit b0f4a66
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions commands/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def report(accounts, config, args):

# Create directory for output file if it doesn't already exists
try:
os.mkdir(os.path.dirname(REPORT_OUTPUT_FILE))
os.mkdir(os.path.dirname(args.output_file))
except OSError:
# Already exists
pass
Expand Down Expand Up @@ -439,10 +439,10 @@ def report(accounts, config, args):
t["findings"][conf["group"]] = group

# Generate report from template
with open(REPORT_OUTPUT_FILE, "w") as f:
with open(args.output_file, "w") as f:
f.write(template.render(t=t))

print("Report written to {}".format(REPORT_OUTPUT_FILE))
print("Report written to {}".format(args.output_file))


def run(arguments):
Expand All @@ -453,6 +453,11 @@ def run(arguments):
default=90,
type=int,
)
parser.add_argument(
"--output-file",
help="Path to write report output to",
default=REPORT_OUTPUT_FILE,
)
parser.add_argument(
"--stats_all_resources",
help="Show stats for all resource types",
Expand Down

0 comments on commit b0f4a66

Please sign in to comment.