feat(editor): add --bulk-rename-by-magic recursive recovery flag

Walks a directory tree, identifies every file by 4-byte magic,
and renames each one to use the correct .w* extension.
Counterpart to single-file --rename-by-magic for the case
where a whole asset bundle came in with mangled extensions
(extracted from a tarball that lost suffixes, downloaded with
CDN-rewritten names, dumped from a database BLOB column).

Same safety semantics as the single-file flag: conflicts are
skipped without --force, --dry-run prints the planned moves
without touching the filesystem. Reports per-file PASS/FAIL/
CONFLICT and a final summary (renamed / skipped-conflict /
already-correct / unrecognized counts). Exits 1 if any
rename failed (e.g. permission errors) so it can be wired
into CI as a gate.
This commit is contained in:
Kelsi 2026-05-09 19:44:52 -07:00
parent 77384f600e
commit d76fa93760
3 changed files with 115 additions and 0 deletions

View file

@ -1355,6 +1355,8 @@ void printUsage(const char* argv0) {
std::printf(" Recursively walk a directory; report per-format file count, total entries, and bytes for every Wowee open format found\n");
std::printf(" --rename-by-magic <file> [--dry-run] [--force]\n");
std::printf(" Recover the correct .w* extension on a file by reading its 4-byte magic. --dry-run prints the planned move; --force overwrites\n");
std::printf(" --bulk-rename-by-magic <dir> [--dry-run] [--force]\n");
std::printf(" Apply --rename-by-magic recursively to every file in <dir>. Conflicts are skipped without --force; exits 1 if any rename failed\n");
std::printf(" --gen-animations <wani-base> [name]\n");
std::printf(" Emit .wani starter: 5 essential animations (Stand / Walk / Run / Death / AttackUnarmed) with fallback chains\n");
std::printf(" --gen-animations-combat <wani-base> [name]\n");