From 37e0e1a76ded34eb4a9bb1de75027b8f4f35be4d Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Wed, 2 Sep 2026 16:40:44 -0700 Subject: [PATCH] refactor(kanban-cli): split the subcommand spec list so no function exceeds 300 LOC --- hermes_cli/kanban_parser.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/hermes_cli/kanban_parser.py b/hermes_cli/kanban_parser.py index 67c91aea75..aacc28aeb6 100644 --- a/hermes_cli/kanban_parser.py +++ b/hermes_cli/kanban_parser.py @@ -132,8 +132,8 @@ def _board_specs(): ] -def _specs(): - """Top-level ``hermes kanban `` records, in ``--help`` order.""" +def _task_specs(): + """``init`` … ``attach-rm``: creation, listing, inspection and attachment verbs.""" return [ _cmd("init", help="Create kanban.db if missing (idempotent)"), _cmd("boards", children=("boards_action", _board_specs()), @@ -291,6 +291,12 @@ def _specs(): ], help="Attach a local file to a task"), _cmd("attachments", [_arg("task_id"), _json_flag()], help="List a task's attachments"), _cmd("attach-rm", [_arg("attachment_id", type=int)], help="Delete an attachment by id"), + ] + + +def _lifecycle_specs(): + """``complete`` … ``repair``: state transitions, dispatcher, notify and maintenance verbs.""" + return [ _cmd("complete", [ _arg("task_ids", nargs="+", help="One or more task ids (only --result applies to all of them)"), @@ -484,6 +490,11 @@ def _specs(): ] +def _specs(): + """Top-level ``hermes kanban `` records, in ``--help`` order.""" + return _task_specs() + _lifecycle_specs() + + def build_parser(parent_subparsers: argparse._SubParsersAction) -> argparse.ArgumentParser: """Attach the ``kanban`` subcommand tree; returns the ``kanban`` parser.""" kanban_parser = parent_subparsers.add_parser(