mirror of
https://github.com/morluto/rea.git
synced 2026-11-18 20:53:00 +00:00
The --llms-full manifest and discovery table rendered raw object keys (--blockSize), which disagreed with command help (--block-size). Reuse optionFlagName so manifests emit the same canonical flags as help, and update the two CLI parity goldens. Adds a boundary test asserting both surfaces agree on canonical flag names.
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import { expect, it } from "vitest";
|
|
import { z } from "zod";
|
|
|
|
import type { CliCommandEntry } from "../../../src/cli/commandRegistry.js";
|
|
import { formatLlmsFull } from "../../../src/cli/commandManifests.js";
|
|
import { formatCommandHelp } from "../../../src/cli/help.js";
|
|
|
|
it("uses the same canonical option flags as command help", () => {
|
|
const command: CliCommandEntry = {
|
|
name: "sample",
|
|
definition: {
|
|
options: z.object({
|
|
blockSize: z.number().optional().describe("Bytes per block"),
|
|
dryRun: z.boolean().default(false).describe("Dry run"),
|
|
}),
|
|
run: () => undefined,
|
|
},
|
|
operations: [],
|
|
source: { kind: "host" },
|
|
};
|
|
const help = formatCommandHelp("rea sample", {
|
|
options: command.definition.options,
|
|
});
|
|
const manifest = formatLlmsFull("rea", [command]);
|
|
|
|
expect(help).toContain("--block-size <number>");
|
|
expect(help).toContain("--dry-run");
|
|
expect(manifest).toContain("| `--block-size` |");
|
|
expect(manifest).toContain("| `--dry-run` |");
|
|
expect(manifest).not.toContain("--blockSize");
|
|
expect(manifest).not.toContain("--dryRun");
|
|
});
|