From 4290b7b2cbeeba4f08446f15c04b64d70dedbabc Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Wed, 29 Jul 2026 08:49:03 +0200 Subject: feat: -a/-g runtime reading toggle and WRAP config option - -a/--all and -g/--gospel override the compiled GOSPEL_ONLY default per run; the reading text for both is always embedded, so this is free. Flags may appear in any position alongside the optional date. - WRAP config.h option wraps reading text at N columns; 0 (default) fits the terminal via TIOCGWINSZ and leaves piped output one line per verse. Greedy, space-breaking, UTF-8 aware (continuation bytes do not count as columns). - Rework arg parsing into a small flag loop; expand -h usage. No table/data change; OF and EF both build clean under -Wall -Wextra. Binary grows ~4 KB (666 KB OF). Stays compile-time-first, suckless-style: the only run-time options are the reading-set toggle and -h. Claude-Session: https://claude.ai/code/session_01S1CD1u3tgSS4xNu6WHfp5a --- config.def.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'config.def.h') diff --git a/config.def.h b/config.def.h index e22075f..53f3378 100644 --- a/config.def.h +++ b/config.def.h @@ -12,15 +12,23 @@ /* --- Colourize the day name with its liturgical colour on a terminal. ---- */ #define COLOR 1 -/* --- Which readings to print. -------------------------------------------- */ +/* --- Which readings to print (the default; override per run with -a / -g). */ #define GOSPEL_ONLY 0 /* 0 = all readings; 1 = the Gospel only */ +/* --- Wrap reading text at a column width. --------------------------------- */ +#define WRAP 0 /* 0 = fit the terminal (no wrap when piped); N = fixed cols */ + /* ------------------------- derived (do not edit) ------------------------- */ #if GOSPEL_ONLY # define READMODE "Gospel only" #else # define READMODE "all readings" #endif +#if WRAP <= 0 +# define WRAPNAME "terminal" +#else +# define WRAPNAME "fixed" +#endif #ifdef FORM_EF # define LITURGY "gen/liturgy_ef.h" # define FORMNAME "Extraordinary Form (1962)" -- cgit v1.3