Kelsidavis-WoWee/tools
Kelsi ec569768fe refactor(editor): hoist consumeJsonFlag into cli_arg_parse.hpp
The pattern

  bool jsonOut = (i + 1 < argc &&
                  std::strcmp(argv[i + 1], "--json") == 0);
  if (jsonOut) i++;

is repeated ~50 times across the editor — every --info-*
and --validate-* handler writes the same three lines to
detect and consume an optional --json follower. Extract
to consumeJsonFlag(int& i, int argc, char** argv) in
cli_arg_parse.hpp (the same header that already hosts
parseOptInt / parseOptFloat / parseOptUint / parseOptArg
for similar repeated patterns).

Adopted in the recently-added files:
  • cli_world_map.cpp     — both --info-womx and --validate-womx
  • cli_sound_catalog.cpp — both --info-wsnd and --validate-wsnd
  • cli_wom_info.cpp      — all 7 --info-* / --validate-wom
                            handlers (replace_all)

Also adopted the shared stripExt() helper from
cli_box_emitter.hpp instead of the new files' rolled-
own stripWomxExt / stripWsndExt — same observable behavior,
no more local copies of the extension-strip logic.

Future --info-/-validate handlers added to other formats
(WSP, WTC, etc.) get the same one-line jsonOut detection
without reinventing the peek-and-advance dance. Any later
adoption of consumeJsonFlag in the older 50+ sites is now
a mechanical replace_all edit per file.

Behavior preserved: --validate-wom and --info-womx and
--info-wsnd round-trip exactly as before, both text and
--json output unchanged.
2026-05-09 14:50:27 -07:00
..
asset_extract feat(extract): --purge-proprietary --json for machine-readable purge report 2026-05-06 11:32:42 -07:00
auth_login_probe Auth: include CRC in legacy proof; extend Turtle integrity set 2026-02-13 01:41:59 -08:00
auth_probe Add authenticator opcode support + auth_probe tool 2026-02-13 00:55:36 -08:00
blp_convert Replace MPQ runtime with loose file asset system 2026-02-12 20:32:14 -08:00
dbc_to_csv tools: fix DBC string-column detection false positives in both dbc_to_csv and asset_extract 2026-03-10 03:49:06 -07:00
editor refactor(editor): hoist consumeJsonFlag into cli_arg_parse.hpp 2026-05-09 14:50:27 -07:00
asset_pipeline_gui.py feat(animation): 452 named constants, 30-phase character animation state machine 2026-04-04 23:02:53 +03:00
backup_assets.sh Fix macOS build process and make shell scripts cross-platform 2026-02-23 18:35:53 -08:00
diff_classic_turtle_opcodes.py chore: fix executable permissions on 6 scripts 2026-03-30 18:55:15 -07:00
gen_opcode_registry.py chore: fix executable permissions on 6 scripts 2026-03-30 18:55:15 -07:00
generate_ffx_sdk_vk_permutations.sh Fix FSR3 permutation script failures on arm64 Linux and Windows 2026-03-09 13:11:03 -07:00
m2_viewer.py feat(animation): 452 named constants, 30-phase character animation state machine 2026-04-04 23:02:53 +03:00
opcode_map_utils.py chore: fix executable permissions on 6 scripts 2026-03-30 18:55:15 -07:00
validate_opcode_maps.py chore: fix executable permissions on 6 scripts 2026-03-30 18:55:15 -07:00