Add --text/--csv stdout render modes with --limit #1

Merged
grahams merged 1 commit from stdout-render-modes into main 2026-08-02 02:08:39 +00:00
Owner

Read-only output modes that print upcoming events and exit without starting the TUI.

  • --text prints Name - Sun 8/9 (8d) lines.
  • --csv prints a name,date,remaining header plus quoted rows (stdlib csv module).
  • --limit N caps either mode to the N soonest events (after prune+sort).

Pure renderers live in store.py sharing _date_label / _remaining / _upcoming helpers so the two modes cannot drift, and both short-circuit before the lazy Textual import so they skip its startup cost. --text/--csv are mutually exclusive with each other and --init; --limit requires one of them and must be >= 0 (guarded via parser.error, exit 2). Empty/all-past/limit=0 prints nothing.

Also adds CLAUDE.md documenting these modes. 47 tests passing.

Read-only output modes that print upcoming events and exit without starting the TUI. - `--text` prints `Name - Sun 8/9 (8d)` lines. - `--csv` prints a `name,date,remaining` header plus quoted rows (stdlib csv module). - `--limit N` caps either mode to the N soonest events (after prune+sort). Pure renderers live in `store.py` sharing `_date_label` / `_remaining` / `_upcoming` helpers so the two modes cannot drift, and both short-circuit before the lazy Textual import so they skip its startup cost. `--text`/`--csv` are mutually exclusive with each other and `--init`; `--limit` requires one of them and must be >= 0 (guarded via parser.error, exit 2). Empty/all-past/limit=0 prints nothing. Also adds CLAUDE.md documenting these modes. 47 tests passing.
Add read-only output modes that print upcoming events and exit without
starting the TUI:

- `--text` prints "Name - Sun 8/9 (8d)" lines.
- `--csv` prints a `name,date,remaining` header plus one row per event,
  quoted via the stdlib csv module.
- `--limit N` caps either mode to the N soonest events (after prune+sort).

Both renderers live in store.py as pure functions sharing `_date_label`
/ `_remaining` / `_upcoming` helpers so the two modes can't drift, and
both short-circuit before the lazy Textual import so they skip its
startup cost. `--text`/`--csv` are mutually exclusive with each other
and `--init`; `--limit` requires one of them and must be >= 0 (all
guarded via parser.error, exit 2). Empty/all-past/limit=0 input prints
nothing.

Also adds CLAUDE.md documenting these modes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
grahams deleted branch stdout-render-modes 2026-08-02 02:08:44 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
grahams/countdown!1
No description provided.