mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-04-28 03:49:31 +00:00
fix: add --prune and --json to KNOWN_FLAGS for spawn status (#2263)
The status command (PR #2254) added --prune and --json flags but did not register them in KNOWN_FLAGS. This caused the CLI to reject them with "Unknown flag" errors before the command could even dispatch. Bump CLI version 0.15.4 -> 0.15.5. Agent: ux-engineer Co-authored-by: B <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
035e4bf830
commit
9e26d74ddb
3 changed files with 14 additions and 8 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@openrouter/spawn",
|
||||
"version": "0.15.4",
|
||||
"version": "0.15.5",
|
||||
"type": "module",
|
||||
"bin": {
|
||||
"spawn": "cli.js"
|
||||
|
|
|
|||
|
|
@ -10,13 +10,13 @@ import { expandEqualsFlags, findUnknownFlag, KNOWN_FLAGS } from "../flags";
|
|||
|
||||
describe("Unknown Flag Detection", () => {
|
||||
describe("detects unknown flags", () => {
|
||||
it("should detect --json as unknown", () => {
|
||||
it("should detect --foo as unknown", () => {
|
||||
expect(
|
||||
findUnknownFlag([
|
||||
"list",
|
||||
"--json",
|
||||
"--foo",
|
||||
]),
|
||||
).toBe("--json");
|
||||
).toBe("--foo");
|
||||
});
|
||||
|
||||
it("should detect --verbose as unknown (middle position)", () => {
|
||||
|
|
@ -50,20 +50,20 @@ describe("Unknown Flag Detection", () => {
|
|||
it("should detect unknown flag at the beginning", () => {
|
||||
expect(
|
||||
findUnknownFlag([
|
||||
"--json",
|
||||
"--foo",
|
||||
"list",
|
||||
]),
|
||||
).toBe("--json");
|
||||
).toBe("--foo");
|
||||
});
|
||||
|
||||
it("should return first unknown when multiple unknown flags", () => {
|
||||
expect(
|
||||
findUnknownFlag([
|
||||
"--json",
|
||||
"--foo",
|
||||
"--verbose",
|
||||
"list",
|
||||
]),
|
||||
).toBe("--json");
|
||||
).toBe("--foo");
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -87,6 +87,8 @@ describe("Unknown Flag Detection", () => {
|
|||
"--debug",
|
||||
"--name",
|
||||
"--reauth",
|
||||
"--prune",
|
||||
"--json",
|
||||
];
|
||||
for (const flag of knownFlagsToTest) {
|
||||
expect(
|
||||
|
|
@ -211,6 +213,8 @@ describe("KNOWN_FLAGS completeness", () => {
|
|||
"--clear",
|
||||
"--custom",
|
||||
"--reauth",
|
||||
"--prune",
|
||||
"--json",
|
||||
];
|
||||
for (const flag of expected) {
|
||||
expect(KNOWN_FLAGS.has(flag)).toBe(true);
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ export const KNOWN_FLAGS = new Set([
|
|||
"--region",
|
||||
"--machine-type",
|
||||
"--size",
|
||||
"--prune",
|
||||
"--json",
|
||||
]);
|
||||
|
||||
/** Return the first unknown flag in args, or null if all are known/positional */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue