Kelsidavis-WoWee/tools/editor/cli_catalog_find.hpp
Kelsi 471ddfef07 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.
2026-05-10 01:09:09 -07:00

11 lines
198 B
C++

#pragma once
namespace wowee {
namespace editor {
namespace cli {
bool handleCatalogFind(int& i, int argc, char** argv, int& outRc);
} // namespace cli
} // namespace editor
} // namespace wowee