From 19487527f96539fce8d83c9260d0605b0472b36f Mon Sep 17 00:00:00 2001 From: Mathieu Broillet Date: Wed, 14 Jun 2023 16:30:17 +0200 Subject: [PATCH] add parser --- run.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/run.py b/run.py index 492c784..31779b9 100644 --- a/run.py +++ b/run.py @@ -1,7 +1,18 @@ +import argparse import logging from src import main if __name__ == '__main__': - logging.basicConfig(format='[%(levelname)s] : %(message)s', level=logging.DEBUG) + parser = argparse.ArgumentParser() + parser.add_argument("-v", "--verbose", help="increase output verbosity", action="store_true") + + + args = parser.parse_args() + + if args.verbose: + logging.basicConfig(format='[%(levelname)s] : %(message)s', level=logging.DEBUG) + else: + logging.basicConfig(format='[%(levelname)s] : %(message)s', level=logging.INFO) + main.run()