Commit graph

3 commits

Author SHA1 Message Date
Kelsi
ec76077b44 feat(editor): add --list-primitives focused introspection
Filtered subset of --list-commands: just procedural primitive
flags (--gen-mesh-* and --gen-texture-*). Walks the shared
kArgRequired registry so it auto-tracks new primitives as they
land — no parallel list to maintain. Useful when authoring
content packs to discover what's available without scrolling
through the full --help dump.

Flags:
  --mesh        — show only --gen-mesh-* (default: both)
  --texture     — show only --gen-texture-* (default: both)
  --json        — JSON output with meshCount/textureCount totals

Currently surfaces 70 procedural mesh primitives and 62
procedural texture primitives. JSON form is well-suited for
piping into sortable / searchable UIs (e.g. content-pack
authoring tools).
2026-05-09 12:25:51 -07:00
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
Kelsi
e117e5aaff refactor(editor): extract CLI introspection handlers into cli_introspect.cpp
Moves five self-discovery handlers (--list-commands,
--info-cli-stats, --info-cli-categories, --info-cli-help,
--gen-completion) out of main.cpp into a new
cli_introspect.{hpp,cpp} module. All five auto-discover
commands by parsing printUsage's stdout via tmpfile capture,
so the surface stays self-describing as new flags are added.

Useful for shell completion scripts that re-exec the binary
at completion time, IDE plugins, and 'is there a flag for X?'
search workflows. main.cpp shrinks by 276 lines (2,298 to
2,022). --validate-cli-help stays inline because it needs
direct access to the static-local kArgRequired array.
2026-05-09 09:31:31 -07:00