From 09f9b00f8646d286787270a7777a957617c8f09f Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Wed, 22 Jul 2026 11:20:16 -0700 Subject: [PATCH] docs: restore parseNiceFlag docblock displaced by PRUNE_STATUSES; note --status/0d in top-level jobs help Co-Authored-By: Claude Fable 5 --- src/cli.ts | 2 +- src/commands/jobs.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index 804d7dbf3..0187e90f2 100755 --- a/src/cli.ts +++ b/src/cli.ts @@ -2387,7 +2387,7 @@ JOBS (Minions) jobs get Job details + history jobs cancel Cancel job jobs retry Re-queue failed/dead job - jobs prune [--older-than 30d] Clean old jobs + jobs prune [--older-than 30d] [--status s,..] Clean old terminal jobs (0d = no age floor) jobs stats Job health dashboard jobs work [--queue Q] Start worker daemon (Postgres only) diff --git a/src/commands/jobs.ts b/src/commands/jobs.ts index 44d8bd4ac..dc502d172 100644 --- a/src/commands/jobs.ts +++ b/src/commands/jobs.ts @@ -106,11 +106,6 @@ export function parseMaxRssFlag(args: string[]): number | undefined { return parsed; } -/** Parse `--nice N` (then `GBRAIN_NICE` env). Returns: - * - undefined if absent (no priority change — inherit) - * - the validated integer in [-20, 19] otherwise - * Errors and exits the process on non-integer / out-of-range input (mirrors - * parseMaxRssFlag's fail-fast). Flag wins over env. (issue #1815) */ /** Terminal statuses `jobs prune --status` accepts (PR #2282). Matches what * queue.prune can safely delete; anything else (waiting/active/…) is live. */ export const PRUNE_STATUSES = ['completed', 'failed', 'dead', 'cancelled'] as const satisfies readonly MinionJobStatus[]; @@ -126,6 +121,11 @@ export function parsePruneStatuses(raw: string): MinionJobStatus[] { return requested as MinionJobStatus[]; } +/** Parse `--nice N` (then `GBRAIN_NICE` env). Returns: + * - undefined if absent (no priority change — inherit) + * - the validated integer in [-20, 19] otherwise + * Errors and exits the process on non-integer / out-of-range input (mirrors + * parseMaxRssFlag's fail-fast). Flag wins over env. (issue #1815) */ export function parseNiceFlag(args: string[], env: NodeJS.ProcessEnv = process.env): number | undefined { const raw = parseFlag(args, '--nice') ?? env.GBRAIN_NICE; if (raw === undefined || raw === '') return undefined;