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:
parent
4cf608eeb6
commit
144acee10f
12 changed files with 122 additions and 104 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue