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));