diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-27 14:59:14 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-27 14:59:14 +0200 |
| commit | cb3379f41c06a94085c77fe359709b46712850dc (patch) | |
| tree | 032801111764c83c3ab089ed101ba4d1222a9abd /internal/cli/cli.go | |
| parent | a13dd6224a095242da54062e4775570c4f16a718 (diff) | |
| download | lectio-cb3379f41c06a94085c77fe359709b46712850dc.tar.gz lectio-cb3379f41c06a94085c77fe359709b46712850dc.zip | |
feat: books.toml -> books.ini, multi-language (add Latin dialect), config-scoped citation display
books.ini with [en]/[pl]/[la]; parseBooks reads INI (bible drops go-toml).
Latin dialect resolves EF citations (Eccli->Sirach, Apoc->Revelation, Luc...);
sigla_style gains 'latin'. Reading citations now DISPLAY in the configured
sigla (FormatRef(SiglaLang)), not raw English. One-shot books.toml->books.ini
user migration (go-toml now config-only). Web settings editor -> books.ini.
Diffstat (limited to 'internal/cli/cli.go')
| -rw-r--r-- | internal/cli/cli.go | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/internal/cli/cli.go b/internal/cli/cli.go index 575fba9..65be274 100644 --- a/internal/cli/cli.go +++ b/internal/cli/cli.go @@ -227,7 +227,7 @@ func Run(args []string, stdin io.Reader, stdout, stderr io.Writer) int { } if citation || week || randV || randCh { - tbl, _ := bible.LoadBookTable(userBooksTOML()) + tbl, _ := bible.LoadBookTable(userBooksINI()) switch { case randV || randCh: ver, verr := randVersion(cfg, bibleVer) @@ -300,7 +300,7 @@ func Run(args []string, stdin io.Reader, stdout, stderr io.Writer) int { var bookTbl *bible.BookTable if list || ref != "" { - tbl, terr := bible.LoadBookTable(userBooksTOML()) + tbl, terr := bible.LoadBookTable(userBooksINI()) if terr != nil { fmt.Fprintln(stderr, "lectio:", terr) // warn; tbl is still a usable defaults table } @@ -516,17 +516,7 @@ func runWeek(cfg config.Config, tbl *bible.BookTable, date string, refresh bool, // userBooksTOML returns the bytes of the optional user books.toml, or nil if // it is absent/unreadable (built-in defaults are used). -func userBooksTOML() []byte { - p, err := config.BooksPath() - if err != nil { - return nil - } - b, err := os.ReadFile(p) - if err != nil { - return nil - } - return b -} +func userBooksINI() []byte { return config.UserBooksINI() } // wantsHelp reports whether -h/--help appears anywhere in args. func wantsHelp(args []string) bool { |
