feat(editor): add --info-magic auto-detect inspector

Reads the first 4 bytes of any file, looks the magic up in
the format table, and reports: format name, file extension,
category, plus the standard catalog header fields (version,
catalog name, entry count) for any of the 33 catalog formats
that share the magic+version+name+entryCount layout.

Also suggests the matching --info-* flag so users who receive
.w* files without context can route to the right inspector
in one step. World/asset formats (WOM/WOB/WHM/WOT/WOW) are
recognized by magic but the catalog-style header probe is
skipped (their layouts differ).

Returns exit 1 + 'unrecognized' message on non-Wowee files.
Supports --json variant for tooling integration.
This commit is contained in:
Kelsi 2026-05-09 19:16:26 -07:00
parent 56ff41799f
commit cdfb55c477
6 changed files with 219 additions and 0 deletions

View file

@ -134,6 +134,7 @@ const char* const kArgRequired[] = {
"--gen-liquids", "--gen-liquids-magical", "--gen-liquids-hazardous",
"--info-wliq", "--validate-wliq",
"--export-wliq-json", "--import-wliq-json",
"--info-magic",
"--gen-weather-temperate", "--gen-weather-arctic",
"--gen-weather-desert", "--gen-weather-stormy",
"--gen-zone-atmosphere",