Skip to content

Commit

Permalink
Make args available
Browse files Browse the repository at this point in the history
  • Loading branch information
pritchyspritch committed May 3, 2024
1 parent 6bbc76a commit dfeab3c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ The output it provides comes from your risks.json that threagile produces, and p

# TODO / Roadmap

- [ ] example GitHub Action to watch file
- [ ] use params for python
- [x] example GitHub Action to watch file
- [x] use params for python
- [ ] produce example sections for common design patterns
- [ ] improve readme
- [ ] automate more of the yaml building beyond what threagile can do
13 changes: 10 additions & 3 deletions produce_risk_tracker.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
import datetime
import argparse


def print_yaml(risk_dict):
Expand All @@ -11,8 +12,8 @@ def print_yaml(risk_dict):
print(f" checked_by: ")


def read_risks_json():
file = open('risks.json')
def read_risks_json(file_path):
file = open(file_path)
data = json.load(file)

date_today_obj = datetime.datetime.now()
Expand All @@ -31,4 +32,10 @@ def read_risks_json():


if __name__ == '__main__':
read_risks_json()
parser = argparse.ArgumentParser(description='Process some integers.')

parser.add_argument('--file', nargs='?', default='risks.json', help='The file path for you risks json file')

args = parser.parse_args()

read_risks_json(args.file)

0 comments on commit dfeab3c

Please sign in to comment.