From 5d325efc7537e3f57c5eeecec35ab20608a67483 Mon Sep 17 00:00:00 2001 From: n0mad1k Date: Thu, 19 Mar 2026 09:03:41 -0400 Subject: [PATCH] Fix Click deprecation warning, use standard invoke_without_command pattern --- mosaic.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/mosaic.py b/mosaic.py index 17a8e80..943daca 100755 --- a/mosaic.py +++ b/mosaic.py @@ -158,17 +158,7 @@ def _load_profiles_fallback() -> list[dict]: # Click CLI # --------------------------------------------------------------------------- -class MosaicCLI(click.Group): - """Custom group that shows the interactive menu when invoked bare.""" - - def invoke(self, ctx): - if not ctx.protected_args and not ctx.invoked_subcommand: - interactive_menu(ctx) - else: - super().invoke(ctx) - - -@click.group(cls=MosaicCLI, invoke_without_command=True) +@click.group(invoke_without_command=True) @click.option("--source", type=str, default=None, help="Source profile name.") @click.option("--url", type=str, default=None, help="Ad-hoc source URL.") @click.option("--profile", "profile_path", type=click.Path(exists=True), default=None, @@ -205,6 +195,9 @@ def cli(ctx, source, url, profile_path, dry_run, retry_failed, since, date_range ctx.obj["verbose"] = verbose ctx.obj["output_dir"] = get_output_dir(cfg) + if ctx.invoked_subcommand is None: + interactive_menu(ctx) + # --------------------------------------------------------------------------- # collect