feat(editor): add --catalog-by-name entry-name substring search

New utility complements --catalog-find (id-based,
single-id lookup) and --catalog-grep (catalog-header
label only) by searching every catalog file under a
directory tree for entries whose `name` field contains a
substring. Reports each hit as [WXXX] file id=N "name"
so the operator can find catalog entries by half-
remembered names — "find anything called Mark of the
Wild" hits all 5 rank entries across WBAB, "find Argent"
hits the WTBD tabard, etc.

Optional flags:
- --magic <WXXX>: limit search to one format family,
  same convention as --catalog-find.
- --ignore-case: lowercase both pattern and haystack
  before substring match.

Returns rc=0 on hits, rc=1 if no entries matched (so the
caller can `if --catalog-by-name ... ; then ...; fi`).
Skips files with unknown magic and files whose format
has no --info-* surface (asset formats like .wom).
Permission-denied subdirs skipped via
skip_permission_denied directory_options.

Closes the search triplet:
  --catalog-grep    catalog-header label
  --catalog-find    entry primary-key id
  --catalog-by-name entry name substring

CLI flag count 1169 -> 1170.
This commit is contained in:
Kelsi 2026-05-10 01:45:09 -07:00
parent 3c8516f8d4
commit 3c69f33465
6 changed files with 298 additions and 1 deletions

View file

@ -137,7 +137,7 @@ const char* const kArgRequired[] = {
"--info-magic", "--summary-dir", "--rename-by-magic",
"--bulk-rename-by-magic", "--touch-tree", "--tree-summary-md",
"--catalog-grep", "--diff-headers", "--audit-tree",
"--catalog-pluck", "--catalog-find",
"--catalog-pluck", "--catalog-find", "--catalog-by-name",
"--magic-fix", "--bulk-validate",
"--bulk-export-json", "--bulk-import-json",
"--diff-tree", "--orphan-jsons", "--list-by-magic",