feat: help 新增 create 命令帮助,更新阶段顺序
This commit is contained in:
@@ -27,6 +27,15 @@ const COMMANDS: Record<string, CommandHelpDef> = {
|
|||||||
detail: "生成 SDD 流程中讨论阶段的提示词,输出到标准输出。需要先运行 init 初始化项目。",
|
detail: "生成 SDD 流程中讨论阶段的提示词,输出到标准输出。需要先运行 init 初始化项目。",
|
||||||
exampleArgs: ["discuss"],
|
exampleArgs: ["discuss"],
|
||||||
},
|
},
|
||||||
|
create: {
|
||||||
|
name: "create",
|
||||||
|
alias: "create <变更>",
|
||||||
|
description: "创建:创建变更目录",
|
||||||
|
usageTemplate: "create <change-name>",
|
||||||
|
args: [{ name: "<change-name>", desc: '变更名称,如 "add-login"' }],
|
||||||
|
detail: "在 .rune/changes/ 下创建以变更名称命名的目录,并生成创建阶段提示词。",
|
||||||
|
exampleArgs: ["create add-user-auth", "create fix-memory-leak"],
|
||||||
|
},
|
||||||
plan: {
|
plan: {
|
||||||
name: "plan",
|
name: "plan",
|
||||||
alias: "plan <变更> <文档>",
|
alias: "plan <变更> <文档>",
|
||||||
@@ -46,7 +55,7 @@ const COMMANDS: Record<string, CommandHelpDef> = {
|
|||||||
description: "构建:生成构建阶段提示词",
|
description: "构建:生成构建阶段提示词",
|
||||||
usageTemplate: "build <change-name>",
|
usageTemplate: "build <change-name>",
|
||||||
args: [{ name: "<change-name>", desc: '变更名称,如 "add-login"' }],
|
args: [{ name: "<change-name>", desc: '变更名称,如 "add-login"' }],
|
||||||
detail: "生成构建阶段的提示词。变更目录需已存在(通过 plan 创建)。",
|
detail: "生成构建阶段的提示词。变更目录需已存在(通过 create 创建)。",
|
||||||
exampleArgs: ["build add-user-auth", "build fix-memory-leak"],
|
exampleArgs: ["build add-user-auth", "build fix-memory-leak"],
|
||||||
},
|
},
|
||||||
archive: {
|
archive: {
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ describe("showGlobalHelp", () => {
|
|||||||
const output = showGlobalHelp("rune");
|
const output = showGlobalHelp("rune");
|
||||||
expect(output).toContain("init <工具...>");
|
expect(output).toContain("init <工具...>");
|
||||||
expect(output).toContain("discuss");
|
expect(output).toContain("discuss");
|
||||||
|
expect(output).toContain("create <变更>");
|
||||||
expect(output).toContain("plan <变更> <文档>");
|
expect(output).toContain("plan <变更> <文档>");
|
||||||
expect(output).toContain("build <名称>");
|
expect(output).toContain("build <名称>");
|
||||||
expect(output).toContain("archive <名称>");
|
expect(output).toContain("archive <名称>");
|
||||||
@@ -48,6 +49,13 @@ describe("showCommandHelp", () => {
|
|||||||
expect(output).toContain("opencode");
|
expect(output).toContain("opencode");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("create 命令包含变更名参数", () => {
|
||||||
|
const output = showCommandHelp("create", "rune");
|
||||||
|
expect(output).toContain("rune create <change-name>");
|
||||||
|
expect(output).toContain("变更名称");
|
||||||
|
expect(output).toContain("rune create add-user-auth");
|
||||||
|
});
|
||||||
|
|
||||||
it("不存在的命令返回 null", () => {
|
it("不存在的命令返回 null", () => {
|
||||||
const output = showCommandHelp("nonexistent", "rune");
|
const output = showCommandHelp("nonexistent", "rune");
|
||||||
expect(output).toBeNull();
|
expect(output).toBeNull();
|
||||||
|
|||||||
Reference in New Issue
Block a user