Add missing dependency 'click-option-group'

This commit is contained in:
2024-07-01 18:29:51 +02:00
parent a7a2809228
commit b3f0f7a3ed
3 changed files with 24 additions and 18 deletions

View File

@@ -37,13 +37,14 @@ logger = logging.getLogger(__name__)
help='Set verbosity')
@click.option('-d', '--debug', is_flag=True, default=False, is_eager=True,
help='Enable debug mode')
@click.option('--dry-run', is_flag=True, default=True, is_eager=True)
@click.option('--dry-run', is_flag=False, default=True, is_eager=True, help='NOT USED!')
@click.option('--cfg-file', type=click.Path(),
default=Path(click.get_app_dir(APP_NAME)).joinpath('iottb.cfg'),
envvar='IOTTB_CONF_HOME', help='Path to iottb config file')
@click.pass_context
def cli(ctx, verbosity, debug, dry_run, cfg_file):
setup_logging(verbosity, debug) # Setup logging based on the loaded configuration and other options
# Setup logging based on the loaded configuration and other options
setup_logging(verbosity, debug)
ctx.ensure_object(dict) # Make sure context is ready for use
logger.info("Starting execution.")
ctx.obj['CONFIG'] = IottbConfig(cfg_file) # Load configuration directly