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
This commit is contained in:
1 parent
8400078656
commit
2055e8c1c9
1 file changed
+4
-1
@@ -146,7 +146,10 @@ export async function main(
|
||||
): Promise<void> {
|
||||
const [dbPath, exportPath, outPath] = argv;
|
||||
if (!dbPath || !exportPath || !outPath) {
|
||||
stderr.write("usage: node scripts/compare-export.ts <cache.sqlite> <export.xml> <out-dir>\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));
|
||||
|
||||
Reference in new issue
Block a user