From 2055e8c1c9c2810ec4265f3b2ed328d341e15580 Mon Sep 17 00:00:00 2001 From: Dan Connolly Date: Wed, 7 Oct 2026 09:42:31 -0500 Subject: [PATCH] fixup! diigo-cache: RSS in diigo's export shape, from cached items compare-export.ts: the usage message comes from the @file manual's synopsis line (read from the script's own source, on the bad-usage path only), docopt-style, so the synopsis lives in one place; if the header changes shape, it says "see the @file comment". Generated-by: Claude Opus 5.5 --- diigo-cache/scripts/compare-export.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/diigo-cache/scripts/compare-export.ts b/diigo-cache/scripts/compare-export.ts index ae28b39..4491239 100644 --- a/diigo-cache/scripts/compare-export.ts +++ b/diigo-cache/scripts/compare-export.ts @@ -146,7 +146,10 @@ export async function main( ): Promise { const [dbPath, exportPath, outPath] = argv; if (!dbPath || !exportPath || !outPath) { - stderr.write("usage: node scripts/compare-export.ts \n"); + // the @file comment is the manual: its indented synopsis line is the usage + const source = await fs.readFile(import.meta.filename, "utf8"); + const synopsis = source.match(/^ \* +(node \S+\.ts .*)$/m)?.[1] ?? "see the @file comment"; + stderr.write(`usage: ${synopsis}\n`); return exit(BAD_USAGE); } const cache = cacheItems(connect(dbPath));