miller/docs
John Kerl 40ac1b309e
Remove os.Exit callsites below the entrypoint: phase 1 (#2198)
* Rebuild docs: help-catalog index count drifted on main (666 -> 667)

Pre-existing drift from a recent catalog addition; surfaced by make dev.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Remove os.Exit callsites below the entrypoint: phase 1 (plans/exit.md)

Phase 1 of plans/exit.md: the mechanical swaps, plus the single-exit-point
scaffolding.

- New sentinel lib.ExitRequest{Code} (io.EOF-style control flow): returned by
  code paths that have already printed what they wanted (--version, -h,
  'put --explain' on a valid expression, 'put -x') instead of exiting mid-stack.
- pkg/entrypoint: new exitOnError() maps errors to exit codes in one place:
  ErrHelpRequested -> 0, ErrUsagePrinted -> 1, ExitRequest -> its code,
  anything else printed (JSON if --errors-json) -> 1.
- pkg/climain: version/help/usage/validation exits become returned errors;
  the ErrHelpRequested/ErrUsagePrinted -> exit translation moves up to the
  entrypoint; loadMlrrcOrDie becomes error-returning loadMlrrcFiles.
- Transformer ParseCLI/constructor exits -> returned errors (cut,
  having_fields, nest, reorder, merge_fields, reshape, rename, split, tee,
  subs, put_or_filter). merge_fields' bad-regex message formerly mis-reported
  itself as coming from the cut verb; tee's unrecognized-option exit was
  formerly silent; split/tee constructor failures formerly exited without
  printing the constructor's error.
- YAML/JSON record-writer marshal errors -> returned through Write, matching
  the CSV writer's error path.
- lib.WriteTempFileOrDie -> WriteTempFile (string, error); its sole caller
  (regtest diff helper) degrades gracefully.

Stderr messages and exit codes are byte-identical for all regression-covered
paths (4779 cases pass); runtime Transform-path exits are phase 3.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Add lib.NewExitZeroRequest() constructor for exit-0 sentinel returns

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-15 11:34:01 -04:00
..
overrides merge 2021-11-22 22:43:15 -05:00
src Remove os.Exit callsites below the entrypoint: phase 1 (#2198) 2026-07-15 11:34:01 -04:00
_config.yml Set theme jekyll-theme-leap-day 2021-11-05 09:41:44 -04:00
build-epub.sh Publish an epub of the docs on Read the Docs (#1835) (#2166) 2026-07-07 14:55:36 -04:00
Makefile Publish an epub of the docs on Read the Docs (#1835) (#2166) 2026-07-07 14:55:36 -04:00
mkdocs.yml More AI skill/MCP docs (#2140) 2026-07-04 14:45:29 -04:00
README.md Page-refactor for CSV/JSON troubleshooting (#2128) 2026-07-03 10:19:09 -04:00
regen.sh Remove Miller-5 source/doc/manpage directories, along with C-build files (#731) 2021-11-04 00:45:44 -04:00
requirements.txt trying https://github.com/squidfunk/mkdocs-material/issues/43 2021-11-04 19:05:15 -04:00
retitle Remove Miller-5 source/doc/manpage directories, along with C-build files (#731) 2021-11-04 00:45:44 -04:00