fix: report bad boot arguments instead of crashing or ignoring them #7

Manually merged
github merged 1 commit from gh-pr/7/head into gh-pr/7/base 2026-11-26 19:55:22 +00:00
Owner

@⁠AutoComput on GitHub · 2026-11-21 10:15 UTC · original
AutoComput:fix/cli-argument-errors → main · +12 −1 · 1 files · 1 commits · merged 2026-11-22 09:58 UTC

TL;DR

  • Problem: A typo on the command line either crashes the emulator or is silently ignored.
  • Fix: Bad options now print a clear error and stop.

scarlettx boot <pkg> --frames abc dies on an uncaught std::invalid_argument from std::stoul. Unknown options, and --frames/--rt-dump/--raster-dump with no value after them, are silently skipped, so a typo like --in-proces boots in the wrong mode without a word.

Both now print an error and return 1. Unknown options also print the usage text.

Tried --frames abc, --frames 2x, --frames and --bogus by hand. The two CTest boot commands and the README examples only use known options. If #3 lands first, --uncapped sits in the same chain and merges fine.

**@⁠AutoComput** on GitHub · 2026-11-21 10:15 UTC · [original](https://github.com/Freminet/ScarlettX/pull/7) `AutoComput:fix/cli-argument-errors` → `main` · +12 −1 · 1 files · 1 commits · merged 2026-11-22 09:58 UTC **TL;DR** - **Problem:** A typo on the command line either crashes the emulator or is silently ignored. - **Fix:** Bad options now print a clear error and stop. `scarlettx boot <pkg> --frames abc` dies on an uncaught `std::invalid_argument` from `std::stoul`. Unknown options, and `--frames`/`--rt-dump`/`--raster-dump` with no value after them, are silently skipped, so a typo like `--in-proces` boots in the wrong mode without a word. Both now print an error and return 1. Unknown options also print the usage text. Tried `--frames abc`, `--frames 2x`, `--frames` and `--bogus` by hand. The two CTest boot commands and the README examples only use known options. If #3 lands first, `--uncapped` sits in the same chain and merges fine.
A non-numeric --frames value threw out of std::stoul and killed the
process. Unknown options and options missing their value were silently
dropped. Both now print an error and exit with 1.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 19:55:22 +00:00
github manually merged commit 8e0dc75778 into gh-pr/7/base 2026-11-26 19:55:22 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.