Add verbose option

This commit is contained in:
moanos [he/him] 2023-01-11 19:29:38 +01:00
parent 5b7347ce71
commit c3b65150d0

6
cli.py
View File

@ -68,9 +68,15 @@ def cli():
parser.add_argument('-i', '--input-file', help="The blocklist to use") parser.add_argument('-i', '--input-file', help="The blocklist to use")
parser.add_argument('-r', '--remote-blocklist', help="The remote blocklist as json for debugging reasons") parser.add_argument('-r', '--remote-blocklist', help="The remote blocklist as json for debugging reasons")
parser.add_argument('-o', '--output', help="Filename where to export the blocklist") parser.add_argument('-o', '--output', help="Filename where to export the blocklist")
parser.add_argument('-v', '--verbose',
action='store_true')
args = parser.parse_args() args = parser.parse_args()
if args.verbose:
logging.basicConfig(level=logging.DEBUG)
else:
logging.basicConfig(level=logging.WARN) logging.basicConfig(level=logging.WARN)
"""if there is a remote blocklist provided load this instead of fetching it from a server (for debugging reasons)"""
if args.remote_blocklist: if args.remote_blocklist:
with open(args.remote_blocklist) as f: with open(args.remote_blocklist) as f:
remote_blocklist = blocklist_json_to_instances(json.load(f)) remote_blocklist = blocklist_json_to_instances(json.load(f))