From fe10bbb33b4fa1b8b5bdf4c7e9afee57f43aeaa9 Mon Sep 17 00:00:00 2001 From: ldericher <40151420+ldericher@users.noreply.github.com> Date: Thu, 2 Dec 2021 17:21:44 +0100 Subject: [PATCH] output verbosity option --- kiwi_scp/scripts/kiwi.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/kiwi_scp/scripts/kiwi.py b/kiwi_scp/scripts/kiwi.py index 764c335..3503270 100644 --- a/kiwi_scp/scripts/kiwi.py +++ b/kiwi_scp/scripts/kiwi.py @@ -5,16 +5,19 @@ import click from kiwi_scp.commands.cli import KiwiCLI +@click.option( + "-v", "--verbose", + help="increase output verbosity", + count=True, +) @click.command(cls=KiwiCLI) -def main() -> None: +def main(verbose: int) -> None: """kiwi is the simple tool for managing container servers.""" - verbosity = 0 - - if verbosity >= 2: + if verbose >= 2: log_level = logging.DEBUG log_format = "[%(asctime)s] %(levelname)s @ %(filename)s:%(funcName)s:%(lineno)d: %(message)s" - elif verbosity >= 1: + elif verbose >= 1: log_level = logging.INFO log_format = "[%(asctime)s] %(levelname)s: %(message)s" else: