WIP: Improve config parsing, make --verbose and --config-file global options

Bonus: Generalize and reuse cmd_ssh()

Signed-off-by: InsanePrawn <insane.prawny@gmail.com>
This commit is contained in:
InsanePrawn 2021-09-09 20:23:23 +02:00
parent 4cf608eeb6
commit 144acee10f
12 changed files with 122 additions and 104 deletions

View file

@ -2,17 +2,15 @@ import click
import logging
import sys
def setup_logging(verbose: bool):
level = logging.INFO
if verbose:
level = logging.DEBUG
level = logging.DEBUG if verbose else logging.INFO
logging.basicConfig(
stream=sys.stdout,
format='%(asctime)s %(levelname)s: %(message)s',
datefmt='%m/%d/%Y %H:%M:%S',
level=level,
)
logging.debug('Logging set up.')
verbose_option = click.option(