diff --git a/scripts/work/cli.mjs b/scripts/work/cli.mjs index 504088a..2b11527 100644 --- a/scripts/work/cli.mjs +++ b/scripts/work/cli.mjs @@ -114,7 +114,12 @@ function mark(status) { } function usage() { - console.log("Usage: pnpm work "); + console.log( + "Usage: pnpm work ", + ); + console.log( + " dispatch Print the next dispatch plan (use --execute to invoke sandcastle)", + ); process.exit(2); } @@ -124,4 +129,10 @@ else if (cmd === "status") printStatus(); else if (cmd === "next") printNext(); else if (cmd === "ready") printReady(); else if (cmd === "blocked") printBlocked(); -else usage(); +else if (cmd === "dispatch") { + // Re-dispatch to the dispatch script so it can handle its own --execute flag + import("./dispatch.mjs").catch((e) => { + console.error(e); + process.exit(1); + }); +} else usage(); diff --git a/scripts/work/cli.test.mjs b/scripts/work/cli.test.mjs index e41a037..c7e169a 100644 --- a/scripts/work/cli.test.mjs +++ b/scripts/work/cli.test.mjs @@ -51,4 +51,9 @@ describe("pnpm work cli", () => { const out = run("blocked"); expect(out.length).toBeGreaterThan(0); }); + + it("dispatch prints a plan", () => { + const out = run("dispatch"); + expect(out).toContain("Dispatch plan"); + }); });