Skip to content

Commit 29d0da2

Browse files
authored
fix(cli): remove unused --json flag from archive command (#2351) (#2356)
The --json flag was defined but never checked in any conditional branch. Output is always JSON. Remove the flag to avoid misleading users into thinking --no-json would switch output format.
1 parent 8c45ca4 commit 29d0da2

File tree

3 files changed

+3
-23
lines changed

3 files changed

+3
-23
lines changed

packages/cli/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,6 @@ npx @kitelev/exocortex-cli archive --dry-run \
496496
- `--year <year>` - Filter by resolution/end timestamp year (e.g. `2025`) **[required for archive mode]**
497497
- `--dry-run` - Preview without writing files
498498
- `--no-referenced` - Skip assets that are still referenced by active (non-archived) files **(default behavior)**. Pass `--referenced` to include them anyway.
499-
- `--json` - Output in JSON format (default: true)
500499

501500
**Exit codes:**
502501

packages/cli/src/commands/archive.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ interface ArchiveCommandOptions {
2020
year?: string;
2121
dryRun?: boolean;
2222
noReferenced?: boolean;
23-
json?: boolean;
2423
verify?: boolean;
2524
cascade?: boolean;
2625
stats?: boolean;
@@ -88,7 +87,6 @@ export function archiveCommand(): Command {
8887
"--no-referenced",
8988
"Skip assets referenced by non-archived (default: true)",
9089
)
91-
.option("--json", "Output in JSON format (default: true)", true)
9290
.option(
9391
"--verify",
9492
"Verify archive integrity instead of archiving (read-only)",

packages/cli/tests/unit/commands/archive.test.ts

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Command } from "commander";
77
* Acceptance criteria:
88
* - Command is registered with correct name and description
99
* - Required options: --vault, --archive-vault
10-
* - Optional options: --class, --year, --dry-run, --no-referenced, --json, --verify, --cascade
10+
* - Optional options: --class, --year, --dry-run, --no-referenced, --verify, --cascade
1111
* - --class and --year are validated at runtime (required for archive, not for verify/cascade)
1212
*/
1313
describe("Issue #2306: archive command", () => {
@@ -72,14 +72,6 @@ describe("Issue #2306: archive command", () => {
7272
expect(option!.mandatory).toBeFalsy();
7373
});
7474

75-
it("should have optional --json flag", () => {
76-
const cmd = archiveCommandFn();
77-
const option = cmd.options.find(
78-
(opt) => opt.long === "--json",
79-
);
80-
expect(option).toBeDefined();
81-
});
82-
8375
it("should have optional --verify flag", () => {
8476
const cmd = archiveCommandFn();
8577
const option = cmd.options.find(
@@ -120,9 +112,9 @@ describe("Issue #2345: archive command dispatch branch tests", () => {
120112
expect(option).toBeDefined();
121113
});
122114

123-
it("should register exactly 10 options total", () => {
115+
it("should register exactly 9 options total", () => {
124116
const cmd = archiveCommandFn();
125-
expect(cmd.options).toHaveLength(10);
117+
expect(cmd.options).toHaveLength(9);
126118
});
127119

128120
it("should have --stats as non-mandatory option", () => {
@@ -163,15 +155,6 @@ describe("Issue #2345: archive command dispatch branch tests", () => {
163155
expect(option!.mandatory).toBeFalsy();
164156
});
165157

166-
it("should have --json default value of true", () => {
167-
const cmd = archiveCommandFn();
168-
const option = cmd.options.find(
169-
(opt) => opt.long === "--json",
170-
);
171-
expect(option).toBeDefined();
172-
expect(option!.defaultValue).toBe(true);
173-
});
174-
175158
it("should have a description mentioning 'archive'", () => {
176159
const cmd = archiveCommandFn();
177160
const description = cmd.description().toLowerCase();

0 commit comments

Comments
 (0)