MCPcopy Create free account
hub / github.com/PatrickSys/codebase-context / exitWithUsageError

Function exitWithUsageError

src/cli-memory.ts:53–71  ·  view source on GitHub ↗
(message: string, usage?: string)

Source from the content-addressed store, hash-verified

51 const removeUsage = 'Usage: codebase-context memory remove <id> [--json]';
52
53 const exitWithUsageError = (message: string, usage?: string): never => {
54 if (useJson) {
55 console.log(
56 JSON.stringify(
57 {
58 status: 'error',
59 message,
60 ...(usage ? { usage } : {})
61 },
62 null,
63 2
64 )
65 );
66 } else {
67 console.error(message);
68 if (usage) console.error(usage);
69 }
70 process.exit(1);
71 };
72
73 if (subcommand === 'list') {
74 const memories = await readMemoriesFile(memoryPath);

Callers 1

handleMemoryCliFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected