From a40d2e924a0148b7e15ecbb17d04488a22a69bfe Mon Sep 17 00:00:00 2001 From: Dan Connolly Date: Wed, 7 Oct 2026 09:40:10 -0500 Subject: [PATCH] fixup! diigo-cache: RSS in diigo's export shape, from cached items MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit compare-export.ts: the usage exit status is a named constant, BAD_USAGE = 2, whose JSDoc cites the convention (Bash Reference Manual ยง3.7.5); the manual just says "Exits 2 on bad usage". Generated-by: Claude Opus 5.5 --- diigo-cache/scripts/compare-export.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/diigo-cache/scripts/compare-export.ts b/diigo-cache/scripts/compare-export.ts index 30dc44e..f805f3c 100644 --- a/diigo-cache/scripts/compare-export.ts +++ b/diigo-cache/scripts/compare-export.ts @@ -8,9 +8,7 @@ * the export, keyed on link: title, tags, description, highlights and * sticky notes. Prints counts to stdout; writes /from-cache.rss * and /report.json (mismatched links, by category). Exits 2 on - * bad usage, the shell's convention. - * - * @see https://www.gnu.org/software/bash/manual/html_node/Exit-Status.html + * bad usage. */ import * as nodeFs from "node:fs/promises"; import { basename, join } from "node:path"; @@ -19,6 +17,14 @@ import { itemDescription, toRss } from "../src/rss.ts"; type Item = Record; +/** + * the exit status for incorrect usage (invalid options, missing + * arguments): the shell's convention + * + * @see https://www.gnu.org/software/bash/manual/html_node/Exit-Status.html + */ +const BAD_USAGE = 2; + /** one export item, as read */ type Exported = { title: string; link: string; description: string }; @@ -142,7 +148,7 @@ export async function main( const [dbPath, exportPath, outPath] = argv; if (!dbPath || !exportPath || !outPath) { stderr.write("usage: node scripts/compare-export.ts \n"); - return exit(2); + return exit(BAD_USAGE); } const cache = cacheItems(connect(dbPath)); const out = outDir(fs, outPath);