mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-10 02:53:51 +00:00
Splits the 138-line static-local kArgRequired array (the list
of flags requiring positional args) into a new
cli_arg_required.{hpp,cpp} module with extern linkage. Then
moves the three meta handlers that depended on it out of
main.cpp into cli_introspect.cpp:
- --validate-cli-help (uses the array for self-check)
- --version / -v (3-line printf)
- --help / -h (1-line passthrough)
main.cpp shrinks by 191 lines (677 to 486). Both the early
missing-argument detector in main() and --validate-cli-help
in cli_introspect.cpp now share one source of truth for the
arg-required list.
24 lines
764 B
C++
24 lines
764 B
C++
#pragma once
|
|
|
|
#include <cstddef>
|
|
|
|
namespace wowee {
|
|
namespace editor {
|
|
namespace cli {
|
|
|
|
// Flat list of every CLI flag that takes one or more positional
|
|
// arguments. main.cpp uses this for the early "missing argument"
|
|
// detector that bails out with a helpful message instead of
|
|
// silently dropping into the GUI; cli_introspect.cpp's
|
|
// --validate-cli-help uses it for the self-check that asserts
|
|
// every entry is documented in printUsage.
|
|
//
|
|
// kArgRequired is null-terminated for backwards compatibility
|
|
// with range-for loops that don't use the size; kArgRequiredSize
|
|
// is the count excluding the terminator.
|
|
extern const char* const kArgRequired[];
|
|
extern const std::size_t kArgRequiredSize;
|
|
|
|
} // namespace cli
|
|
} // namespace editor
|
|
} // namespace wowee
|