mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-10 02:53:51 +00:00
refactor(editor): extract dep/orphan handlers into cli_deps.cpp
Moves the three asset-dependency analysis handlers
(--list-zone-deps, --list-project-orphans,
--remove-project-orphans) out of main.cpp into a new
cli_deps.{hpp,cpp} module. All three surface the relationship
between content references (objects.json + WOB doodad lists)
and on-disk model files: list-deps enumerates what a zone
needs, list-orphans flips that into 'what's on disk but
unreferenced', and remove-orphans deletes the resulting set
(with --dry-run for safe previews).
main.cpp shrinks by 355 lines (3,319 to 2,964) and finally
drops below 3K. The shared 'normalize basename' rule for
matching path references stays duplicated between the list
and remove handlers — a deliberate tradeoff, with comments
flagging the sync requirement.
This commit is contained in:
parent
4db41b5974
commit
6821549856
4 changed files with 432 additions and 359 deletions
20
tools/editor/cli_deps.hpp
Normal file
20
tools/editor/cli_deps.hpp
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#pragma once
|
||||
|
||||
namespace wowee {
|
||||
namespace editor {
|
||||
namespace cli {
|
||||
|
||||
// Dispatch the asset-dependency analysis handlers. All three
|
||||
// surface the relationship between content references
|
||||
// (objects.json placements + WOB doodad lists) and on-disk
|
||||
// model files, supporting --json output for CI pipelines.
|
||||
// --list-zone-deps enumerate external model paths a zone needs
|
||||
// --list-project-orphans on-disk .wom/.wob files no zone references
|
||||
// --remove-project-orphans destructive cleanup (with --dry-run)
|
||||
//
|
||||
// Returns true if matched; outRc holds the exit code.
|
||||
bool handleDeps(int& i, int argc, char** argv, int& outRc);
|
||||
|
||||
} // namespace cli
|
||||
} // namespace editor
|
||||
} // namespace wowee
|
||||
Loading…
Add table
Add a link
Reference in a new issue