fix(cli): translate Commander --no-stats into noStats option (#704)

Commander's negatable-boolean convention sets options.stats = false when
--no-stats is passed, not options.noStats = true. The three call sites
that forward CLI options into runFullAnalysis / generateAIContextFiles
read options.noStats, so the flag was silently ignored and symbol counts
always got written into AGENTS.md / CLAUDE.md.

Fix: add ?? (options?.stats === false) fallback at all three call sites.
This commit is contained in:
Jonas Vanderhaegen 2026-04-24 12:36:38 +02:00
parent 5b1966c2ca
commit 83b9a268e3
2 changed files with 3 additions and 3 deletions

View file

@ -228,7 +228,7 @@ export const analyzeCommand = async (inputPath?: string, options?: AnalyzeOption
embeddings: options?.embeddings,
skipGit: options?.skipGit,
skipAgentsMd: options?.skipAgentsMd,
noStats: options?.noStats,
noStats: options?.noStats ?? (options?.stats === false),
registryName: options?.name,
// Registry-collision bypass — its own CLI flag, intentionally NOT
// overloading --force. A user who hits the collision guard should
@ -298,7 +298,7 @@ export const analyzeCommand = async (inputPath?: string, options?: AnalyzeOption
processes: s.processes,
},
skillResult.skills,
{ skipAgentsMd: options?.skipAgentsMd, noStats: options?.noStats },
{ skipAgentsMd: options?.skipAgentsMd, noStats: options?.noStats ?? (options?.stats === false) },
);
}
} catch {

View file

@ -379,7 +379,7 @@ export async function runFullAnalysis(
processes: pipelineResult.processResult?.stats.totalProcesses,
},
undefined,
{ skipAgentsMd: options.skipAgentsMd, noStats: options.noStats },
{ skipAgentsMd: options.skipAgentsMd, noStats: options.noStats ?? (options.stats === false) },
);
} catch {
// Best-effort — don't fail the entire analysis for context file issues