Skip to main content

EXIT_CODES_HELP

Constant EXIT_CODES_HELP 

Source
pub const EXIT_CODES_HELP: &str = "\
Exit codes:
  0  success
  1  generic failure (catch-all for non-classified errors)
  2  usage error (clap argument-parse failure — unknown flag, bad value)
  3  not found (entity / mem / resource missing)
  4  hash mismatch (optimistic-locking failure on a mutation)
  5  validation / schema / policy refusal

  For programmatic branching, prefer `--json` over the exit code:
    memstead <subcommand> ... --json | jq -r .code
  The JSON envelope's `code` field carries the typed token
  (e.g. INVALID_TITLE, HAS_INCOMING_REFS, CROSS_MEM_LINK_NOT_ALLOWED)
  with structured recovery details under `.details`.";
Expand description

Top-level --help epilog describing the exit-code posture. The taxonomy is intentionally coarse — success vs failure — because agents read JSON, not exit codes, and shell scripts can lift the granular code from --json | jq .code.