summaryrefslogtreecommitdiff
path: root/internal/cli/cli.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/cli/cli.go')
-rw-r--r--internal/cli/cli.go16
1 files changed, 14 insertions, 2 deletions
diff --git a/internal/cli/cli.go b/internal/cli/cli.go
index eb01039..364e080 100644
--- a/internal/cli/cli.go
+++ b/internal/cli/cli.go
@@ -219,6 +219,9 @@ func Run(args []string, stdin io.Reader, stdout, stderr io.Writer) int {
fmt.Fprintln(stderr, "lectio:", err)
return 1
}
+ if dir, err := config.CorporaDir(); err == nil {
+ bible.SetUserCorporaDir(dir)
+ }
if offline {
cfg.Offline = true
}
@@ -1031,8 +1034,12 @@ func lookupRef(cfg config.Config, tbl *bible.BookTable, ref string, versions []s
}
// runList handles --list: print every book of the sigla dialect (scriptural
-// order) as "<shortcut> <name>". The shortcut column is padded by rune count
-// so diacritics ("Łk") still line up.
+// order) as "<shortcut> <name>", followed by a "Versions:" block listing
+// every known bible corpus -- built-in and user/drop-in alike (see
+// bible.Corpora, which SetUserCorporaDir keeps current) -- as "<code>
+// <label>". A corpus with no localized i18n chrome label (any user corpus,
+// e.g.) shows its sidecar Name instead (see versionDisplayName). The
+// shortcut column is padded by rune count so diacritics ("Łk") still line up.
func runList(tbl *bible.BookTable, dialect string, stdout io.Writer) int {
const col = 8
for _, b := range tbl.Books(dialect) {
@@ -1042,6 +1049,11 @@ func runList(tbl *bible.BookTable, dialect string, stdout io.Writer) int {
}
fmt.Fprintf(stdout, "%s%s%s\n", b.Shortcut, strings.Repeat(" ", pad), b.Name)
}
+ fmt.Fprintln(stdout)
+ fmt.Fprintln(stdout, "Versions:")
+ for _, m := range bible.Corpora() {
+ fmt.Fprintf(stdout, " %-6s %s\n", m.Code, versionDisplayName(dialect, m.Code))
+ }
return 0
}