Function
exitWithUsageError
(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); |
Tested by
no test coverage detected