Skip to content

Commit

Permalink
Hook up audit display-results command in args parser
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Zhou committed Jul 2, 2019
1 parent ea965f8 commit 2ec25e4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
13 changes: 12 additions & 1 deletion detect_secrets/core/usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,9 @@ def add_arguments(self):
),
)

self.parser.add_argument(
action_parser = self.parser.add_mutually_exclusive_group()

action_parser.add_argument(
'--diff',
action='store_true',
help=(
Expand All @@ -219,6 +221,15 @@ def add_arguments(self):
),
)

action_parser.add_argument(
'--display-results',
action='store_true',
help=(
'Displays the results of an interactive auditing session '
'which have been saved to a baseline file.'
),
)

return self


Expand Down
6 changes: 5 additions & 1 deletion detect_secrets/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,14 @@ def main(argv=None):
)

elif args.action == 'audit':
if not args.diff:
if not args.diff and not args.display_results:
audit.audit_baseline(args.filename[0])
return 0

if args.display_results:
audit.print_audit_results(args.filename[0])
return 0

if len(args.filename) != 2:
print(
'Must specify two files to compare!',
Expand Down

0 comments on commit 2ec25e4

Please sign in to comment.