mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-10 19:13:52 +00:00
Natural follow-up to --audit-tree: when that utility flags ext-mismatch or magic-no-ext issues, --magic-fix proposes (and optionally applies) the renames that resolve them. Walks a directory recursively, reads each file's 4-byte magic, looks it up in the format table, and renames to the canonical extension when the current extension doesn't match (or is absent). Defaults to dry-run for safety — prints the proposed renames so they can be reviewed first; pass --apply to commit them. Refuses to clobber existing files: when the target path already exists (e.g. foo.wsct + foo.wsrg both with WSRG magic), the rename is flagged as a collision and skipped, leaving both files in place for manual resolution. Returns exit 1 if any proposals exist (in dry-run) or any collisions are skipped (in apply), so it composes into shell pipelines. JSON sidecar via --json. Suggested workflow: --audit-tree dir # find what's broken --magic-fix dir # preview the auto-fixes --magic-fix dir --apply # commit them --audit-tree dir # confirm clean CLI flag count 921 -> 922.
11 lines
195 B
C++
11 lines
195 B
C++
#pragma once
|
|
|
|
namespace wowee {
|
|
namespace editor {
|
|
namespace cli {
|
|
|
|
bool handleMagicFix(int& i, int argc, char** argv, int& outRc);
|
|
|
|
} // namespace cli
|
|
} // namespace editor
|
|
} // namespace wowee
|