From e36e5a1428bba003bd02175ba0de21f0cd910731 Mon Sep 17 00:00:00 2001 From: shagi Date: Sun, 8 Nov 2020 20:04:07 +0100 Subject: [PATCH] Add verbose flag --- negromate/songs/commands/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/negromate/songs/commands/__init__.py b/negromate/songs/commands/__init__.py index 4e7ce11..bc5451e 100644 --- a/negromate/songs/commands/__init__.py +++ b/negromate/songs/commands/__init__.py @@ -1,5 +1,6 @@ import argparse import configparser +import logging import traceback import sys from pathlib import Path @@ -91,6 +92,9 @@ def main(): # Build parser parser = argparse.ArgumentParser() + parser.add_argument( + '-v', '--verbose', action='store_true', + help="Display informational messages.") parser.set_defaults(command=None) subparsers = parser.add_subparsers() for command in commands: @@ -100,6 +104,8 @@ def main(): # Run command args = parser.parse_args(args[1:]) + if args.verbose: + logging.basicConfig(level=logging.DEBUG) if args.command is None: parser.print_usage() else: