From 913e2a2dd8746836dcf22fe767009d97fe9fdb84 Mon Sep 17 00:00:00 2001 From: Ivan Ogasawara Date: Tue, 23 Jul 2024 22:06:20 -0400 Subject: [PATCH] feat(help): Organize tasks by group inside the help menu --- src/makim/cli.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/makim/cli.py b/src/makim/cli.py index 97b0124..88aca33 100644 --- a/src/makim/cli.py +++ b/src/makim/cli.py @@ -272,7 +272,13 @@ def create_dynamic_command(name: str, args: Dict[str, str]) -> None: args_param_list.append(f'"--{arg}": {arg_clean}') args_param_str = '{' + ','.join(args_param_list) + '}' - decorator = app.command(name, help=args.get('help', '')) + group_name = name.split('.')[0] + + decorator = app.command( + name, + help=args.get('help', ''), + rich_help_panel=group_name, + ) function_code = ( f'def dynamic_command({args_str}):\n'