Kelsidavis-WoWee/tools/editor/cli_arg_required.hpp
Kelsi 0e8ef746af refactor(editor): extract kArgRequired + meta handlers into cli modules
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.
2026-05-09 10:08:14 -07:00

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