From 86a422f7e2daaab73a152ca11ca9badd884a8899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=A9=98?= Date: Thu, 7 May 2026 14:54:02 +0000 Subject: [PATCH] =?UTF-8?q?fix(cli):=20nits=20from=20review=20=E2=80=94=20?= =?UTF-8?q?live=20--latest=20in=20args,=20dispatchInit=20uses=20dispatchGr?= =?UTF-8?q?oup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 小橘 🍊 --- packages/cli-workflow/src/cli-dispatch.ts | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/packages/cli-workflow/src/cli-dispatch.ts b/packages/cli-workflow/src/cli-dispatch.ts index 7a0c9fe..c95f61f 100644 --- a/packages/cli-workflow/src/cli-dispatch.ts +++ b/packages/cli-workflow/src/cli-dispatch.ts @@ -444,7 +444,7 @@ const THREAD_SUBCOMMAND_TABLE: Record = { kill: { handler: dispatchKill, args: "", description: "Kill a running thread" }, live: { handler: dispatchLive, - args: " [--debug] [--role ]", + args: " | --latest [--debug] [--role ]", description: "Attach to a thread and stream output live", }, pause: { handler: dispatchPause, args: "", description: "Pause a running thread" }, @@ -573,18 +573,11 @@ function dispatchGroup( } async function dispatchInit(storageRoot: string, argv: string[]): Promise { + const result = dispatchGroup("init", INIT_SUBCOMMAND_TABLE, storageRoot, argv); + if (result !== null) { + return result; + } const sub = argv[0]; - const name = argv[1]; - if (sub === undefined || name === undefined || argv.length > 2) { - printCliError(`${formatCliUsage()}\n\nerror: init requires workspace|template `); - return 1; - } - - const entry = INIT_SUBCOMMAND_TABLE[sub]; - if (entry !== undefined) { - return entry.handler(storageRoot, argv.slice(1)); - } - printCliError(`${formatCliUsage()}\n\nerror: unknown init subcommand: ${sub}`); return 1; } -- 2.43.0