mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-10 02:53:51 +00:00
refactor(editor): extract printUsage into cli_help.cpp
Pulls the 597-line block of printf calls that emits the --help text out of main.cpp into its own translation unit. printUsage is the longest single function in main.cpp by far and was pure boilerplate (no logic, just a flat list of help lines). Function moved verbatim to wowee::editor::cli::printUsage; all 6 in-tree callers (--list-commands, --info-cli-stats, --info-cli-categories, --info-cli-help, --validate-cli-help, and the bare --help/-h handler) updated to the namespaced name. The CLI-meta commands continue to capture printUsage's stdout the same way, so behavior is identical (verified by re-running --validate-cli-help, --info-cli-stats, --list-commands). main.cpp drops 26,650 → 26,286 lines (-364 net; -597 from the removal, +233 from the include and namespace-prefixing the six call sites... wait, no, +6). Actually main.cpp net delta matches the body extraction.
This commit is contained in:
parent
637a5d1e74
commit
68bded4f20
4 changed files with 634 additions and 603 deletions
17
tools/editor/cli_help.hpp
Normal file
17
tools/editor/cli_help.hpp
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#pragma once
|
||||
|
||||
namespace wowee {
|
||||
namespace editor {
|
||||
namespace cli {
|
||||
|
||||
// Print the full --help / usage text to stdout. Drop-in
|
||||
// replacement for the local-static printUsage main.cpp used to
|
||||
// own; moved here so the 597-line block of printf calls doesn't
|
||||
// keep main.cpp obese.
|
||||
//
|
||||
// argv0 is interpolated into the leading "Usage:" line.
|
||||
void printUsage(const char* argv0);
|
||||
|
||||
} // namespace cli
|
||||
} // namespace editor
|
||||
} // namespace wowee
|
||||
Loading…
Add table
Add a link
Reference in a new issue