described

tcmts.cli.help.described · #pg77akzu · term · runs on the server

uses tcmts.cli.style.dim, which uses node:util

import { fallback } from "#codebase/tcmts/cli/help";
import type { ParamShape } from "#codebase/tcmts/cli/help";
import { dim } from "#codebase/tcmts/cli/style";

export function described(p: ParamShape): string {
  const d = fallback(p)?.value;
  const shown = d === undefined || d === false || d === true || (Array.isArray(d) && !d.length) ? "" : dim(` (default ${String(d)})`);
  return `${p.description ?? ""}${shown}`;
}

uses

used by