argLabel

tcmts.cli.help.argLabel · #yekws3gg · term · runs anywhere

<name>, [file], [names...]: an argument as usage shows it.

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

export function argLabel(p: ParamShape): string {
  const n = `${p.name}${p.cardinality === "many" ? "..." : ""}`;
  return fallback(p) ? `[${n}]` : `<${n}>`;
}

uses

used by