diff options
author | Michał Górny <mgorny@gentoo.org> | 2019-02-26 08:42:16 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2019-02-26 09:05:49 +0100 |
commit | 2904891c24d9b0d5ce6022c5175845cd8bc50d44 (patch) | |
tree | 6e857206d8c09dd1e67710e314cade740f5b80ad | |
parent | 9ff2b7e566716edb40bc6b9d34fde9174d60c141 (diff) | |
download | gemato-2904891c24d9b0d5ce6022c5175845cd8bc50d44.tar.gz |
cli: Support debug logging
-rw-r--r-- | gemato/cli.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gemato/cli.py b/gemato/cli.py index 15e46ad..04ada3b 100644 --- a/gemato/cli.py +++ b/gemato/cli.py @@ -1,6 +1,6 @@ # gemato: CLI routines # vim:fileencoding=utf-8 -# (c) 2017-2018 Michał Górny +# (c) 2017-2019 Michał Górny # Licensed under the terms of 2-clause BSD license from __future__ import print_function @@ -51,14 +51,16 @@ class GematoCommand(object): """ Add options specific to the command to subparser @subp. """ - pass + subp.add_argument('--debug', action='store_true', + help='Enable debugging output') def parse_args(self, args, argp): """ Process command-line arguments @args. @argp is the argparse instance provided for error reporting. """ - pass + if args.debug: + logging.getLogger().setLevel(logging.DEBUG) def __call__(self): """ |