Skip to content

Commit

Permalink
Command line client --blacklisted-return-code option (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
gjedeer authored and afilipovich committed Apr 2, 2019
1 parent e676724 commit 89c4665
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bin/gglsbl_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ def setupArgsParser():
type=int,
help=('SQLite connection timeout. Default is 10 seconds. Increase if you get'
' occasional "database is locked" errors'))
parser.add_argument('--blacklisted-return-code',
default=0,
type=int,
help='Return this code from process when URL is blacklisted')
return parser


Expand Down Expand Up @@ -81,6 +85,7 @@ def main():
print('{} is not blacklisted'.format(args.check_url))
else:
print('{} is blacklisted in {}'.format(args.check_url, bl))
sys.exit(args.blacklisted_return_code)
sys.exit(0)
if args.onetime:
sbl = SafeBrowsingList(args.api_key, db_path=args.db_path, discard_fair_use_policy=True, timeout=args.timeout)
Expand Down

0 comments on commit 89c4665

Please sign in to comment.