Cli: refuse an option that has no value #63

Closed
github-bot wants to merge 1 commit from gh-pr/63/head into gh-pr/63/base
Owner

@⁠vaibhavgupta443 on GitHub · 2026-11-26 19:42 UTC · original
fix/cli-option-missing-value → main · +60 −6 · 4 files · 1 commits · closed without merging

What

An option typed without its value was dropped, so the command ran without it:

  • archive carve ... --limit-mb carved with no limit.
  • audio export ... --codec --decode-xma took the flag as the codec, so the flag was lost.

Change

A missing value, or a next argument starting with --, now prints fivestar: <option> needs a value and exits with code 2.

This covers the argument reader used by archive, audio, exe, model, platform, profile, progress and texture. An unrecognised option at the end of the line, which was ignored before, is now refused too. The separate reader in FiveStar.Cli.Shader is unchanged.

How I checked

  • dotnet build FiveStar.slnx: 0 warnings, 0 errors.
  • FiveStar.Architecture.Tests: 31 passed.
  • FiveStar.Cli.Tests: 15 passed, 7 skipped.
  • Both cases of the new test failed before the fix.
  • No game files were used. The other test projects were not run locally.
**@⁠vaibhavgupta443** on GitHub · 2026-11-26 19:42 UTC · [original](https://github.com/ThatRecompDev/five-star-recomp/pull/63) `fix/cli-option-missing-value` → `main` · +60 −6 · 4 files · 1 commits · closed without merging ## What An option typed without its value was dropped, so the command ran without it: - `archive carve ... --limit-mb` carved with no limit. - `audio export ... --codec --decode-xma` took the flag as the codec, so the flag was lost. ## Change A missing value, or a next argument starting with `--`, now prints `fivestar: <option> needs a value` and exits with code 2. This covers the argument reader used by `archive`, `audio`, `exe`, `model`, `platform`, `profile`, `progress` and `texture`. An unrecognised option at the end of the line, which was ignored before, is now refused too. The separate reader in `FiveStar.Cli.Shader` is unchanged. ## How I checked - `dotnet build FiveStar.slnx`: 0 warnings, 0 errors. - `FiveStar.Architecture.Tests`: 31 passed. - `FiveStar.Cli.Tests`: 15 passed, 7 skipped. - Both cases of the new test failed before the fix. - No game files were used. The other test projects were not run locally.
An option typed without its value was dropped, so the command ran as if it had not been given: archive carve ... --limit-mb carved without a limit, and audio export ... --codec --decode-xma took the flag as the codec.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 03:16:24 +00:00
github-bot closed this pull request 2026-11-27 03:16:24 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.