feat(editor): add --catalog-find directory-wide id search

New utility complements --catalog-pluck (single-file id
lookup) by walking a directory tree recursively and
searching every catalog for entries whose primary key
matches the supplied id. Reports each hit as
[WXXX] file:fieldName=id "name" so the operator can
locate where any given id lives across a 100+ format
project. Useful when chasing cross-references like "id
631 is referenced by WGRP.mapId — where is it actually
defined?"

Optional --magic <WXXX> filter narrows the search to one
format family. Necessary because primary-key id ranges
overlap across formats (id=200 might be both a WCMG
group and a WGRP composition); without the filter the
operator gets all collisions, which is itself useful
for spotting unintentional id reuse.

Auto-detects per-file format magic, skips files with
unknown magic and files whose format has no --info-*
surface (asset formats like .wom that aren't catalog-
shaped). Re-uses the same primary-key auto-discovery
+ external-ref filter as --catalog-pluck. Both
utilities should grow into a shared helper header once
a third utility needs the same lookup logic — for now
a noted duplication.

CLI flag count 1133 -> 1134.
This commit is contained in:
Kelsi 2026-05-10 01:09:09 -07:00
parent dc0c71fdd7
commit 471ddfef07
6 changed files with 341 additions and 1 deletions

View file

@ -147,6 +147,7 @@
#include "cli_realm_list_catalog.hpp"
#include "cli_emotes_catalog.hpp"
#include "cli_catalog_pluck.hpp"
#include "cli_catalog_find.hpp"
#include "cli_quest_objective.hpp"
#include "cli_quest_reward.hpp"
#include "cli_clone.hpp"
@ -335,6 +336,7 @@ constexpr DispatchFn kDispatchTable[] = {
handleRealmListCatalog,
handleEmotesCatalog,
handleCatalogPluck,
handleCatalogFind,
handleQuestObjective,
handleQuestReward,
handleClone,