diff --git a/subliminal/cli.py b/subliminal/cli.py index 71ae26a7..19cf293b 100644 --- a/subliminal/cli.py +++ b/subliminal/cli.py @@ -221,6 +221,7 @@ def decorator(f: Callable) -> Callable: PROVIDERS_OPTIONS_CLI_TEMPLATE.format(ext=group_name, plugin=plugin_name, key=name), PROVIDERS_OPTIONS_TEMPLATE.format(ext=group_name, plugin=plugin_name, key=name), ) + # Setting the default value also decides on the type attrs = { 'default': opt['default'], 'help': opt['desc'], @@ -232,7 +233,7 @@ def decorator(f: Callable) -> Callable: key=name.upper(), ), } - click_option(*param_decls, **attrs)(f) + f = click_option(*param_decls, **attrs)(f) # type: ignore[operator] return f return decorator @@ -290,6 +291,7 @@ def decorator(f: Callable) -> Callable: @click.pass_context def subliminal( ctx: click.Context, + /, cache_dir: str, debug: bool, **kwargs: Any, @@ -323,8 +325,8 @@ def subliminal( ctx.obj['debug'] = debug # create provider and refiner configs - provider_configs = {} - refiner_configs = {} + provider_configs: dict[str, dict[str, Any]] = {} + refiner_configs: dict[str, dict[str, Any]] = {} for k, v in kwargs.items(): try_split = k.split('__')