From 147932ae2da02b5eceb6be6e1d704e1199bcb72e Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Fri, 21 Aug 2026 09:51:36 +0200 Subject: fix(colitur-x): detect the CSV header instead of assuming it Skipping the first line unconditionally punished the obvious way to view one month -- colitur emit --format csv ... | grep '^2027-04' | colitur-x -- by silently eating 1 April, because grep had already removed the header the program still expected. A filter is exactly what this program should compose with. A header is the line beginning 'date,'; anything else is a day. Verified all three ways: full year with header 365 rows from 01-01, a grepped month without header 30 rows from 04-01, and the old head -1 incantation still 30 rows. --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index b0872cf..9df7b8e 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,12 @@ Keys: arrows or `hjkl` move, `n`/`p` change month, `q` quits. It reads CSV on **stdin** and nothing else, so the shell decides what it shows. One month: - colitur emit --format csv --from 2027 --to 2027 \ - | { head -1; grep "^2027-04"; } | colitur-x + colitur emit --format csv --from 2027 --to 2027 | grep "^2027-04" | colitur-x + +The header line is detected rather than assumed, so filtering it away is +fine. An earlier version skipped the first line unconditionally, which meant +that pipeline silently dropped 1 April -- the program fought the obvious +filter instead of composing with it. Another language, or a local calendar: -- cgit v1.3