From 67c16b2a2307b6cdf5bd89ba1a59aa8ae17007ac Mon Sep 17 00:00:00 2001 From: Leo Schick Date: Mon, 27 Nov 2023 16:59:22 +0100 Subject: [PATCH] skip 'mara-' prefix from multi commands --- mara_cli/cli.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mara_cli/cli.py b/mara_cli/cli.py index 8efffad..e61ca0b 100644 --- a/mara_cli/cli.py +++ b/mara_cli/cli.py @@ -63,8 +63,10 @@ def setup_commandline_commands(): package = command.__dict__['callback'].__module__.rpartition('.')[0] # Give a package a chance to put all their commands as subcommands of the main package name. # For that to work we have to make sure we do not add multiple commands with the same name - if isinstance(command, click.Group): + if isinstance(command, click.MultiCommand): name = command.name + if name.startswith('mara-'): + name = name[5:] else: name = package + '.' + command.name if name in known_names: