Skip to content

lore: the search table, three hand-rolled flag sets, and thirteen fmt.Print adopt the convention #775

Description

@David-Noble-at-work

Plan: docs/plans/feature/775-lore-adoption.md
Related: #741 (kept separate — see below), #743

lore registers the common set on inspect alone. Every other command invents its own output, and the
one real table in the tree is hand-rolled.

What has to happen

runSearch's table (commands.go:525-556) moves onto the shared TableFormatter. It is the only real
table in the tree, and it carries a defect — byte-count truncation cutting multi-byte characters mid-rune.

Three hand-rolled flag sets go:

Command Today Why it is wrong
lore bundle --output, -o <path> a destination, not a rendering — collides with the shared -o
lore onboard --output <dir> + --format own --format, own destination
lore list --format table|manifest|json own --format, values differ from the shared set

lore list is a stub returning "not yet implemented", so it adapts at no cost. Its --format manifest is a
domain rendering and does not join the shared set.

Thirteen fmt.Print calls are triaged: narration to cli.*, results to the sink.

The common set registers on the root, not on inspect alone — which is what makes a program-wide
fix program-wide.

Why #741 stays its own issue

#741 is a correctness bug: lore search truncates by byte count and cuts multi-byte characters mid-rune.
It happens to live in the code this issue rewrites. Folding it in would bury a user-visible fix inside a
refactor, so it stays separate and this issue closes it only if the rewrite genuinely fixes it — which
moving onto TableFormatter, which is rune-aligned via text/tabwriter, should.

An exception recorded, not decided

lore list defaults to table today, against the json-always default. Whether any command needs such an
exception is an open question on the epic, and this issue does not settle it.

Plan and design documents

Kind Document
Plan docs/plans/feature/775-lore-adoption.md

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions