Affected version(s)
2.1.12-preview (and current main)
Is this a regression?
NO - This bug also affected the previous version
Context
Option validation for bv subcommands lives in two places: CommandArgumentValidator (rejects forwarded tokens and excess positionals) and each command's *Settings.Parse, which throws on reader.Remaining.Count > 0. Commands with no settings type (clean, version show) have no Parse — so their option tokens are never inspected by anyone.
Expected behavior
> bv clean --bogus
error: Unknown option '--bogus' for command 'clean'.
Actual behavior
--bogus is silently ignored and the command runs normally. Typos in real options or options meant for another subcommand go unnoticed.
How to reproduce
dotnet bv clean --bogus — exits 0, cleans as if nothing happened.
Configuration
bv CLI tool, any OS.
Other information
Likely fix: in CommandArgumentValidator, reject any leftover option token for non-forwarding commands whose SettingsType is null (commands with settings keep their existing Remaining check).
Acceptance criteria:
- unknown options are rejected for settings-less commands;
- tests cover both settings-less and settings-carrying commands;
- CHANGELOG entry under Unreleased changes.
Affected version(s)
2.1.12-preview (and current
main)Is this a regression?
NO - This bug also affected the previous version
Context
Option validation for
bvsubcommands lives in two places:CommandArgumentValidator(rejects forwarded tokens and excess positionals) and each command's*Settings.Parse, which throws onreader.Remaining.Count > 0. Commands with no settings type (clean,version show) have noParse— so their option tokens are never inspected by anyone.Expected behavior
Actual behavior
--bogusis silently ignored and the command runs normally. Typos in real options or options meant for another subcommand go unnoticed.How to reproduce
dotnet bv clean --bogus— exits 0, cleans as if nothing happened.Configuration
bvCLI tool, any OS.Other information
Likely fix: in
CommandArgumentValidator, reject any leftover option token for non-forwarding commands whoseSettingsTypeisnull(commands with settings keep their existingRemainingcheck).Acceptance criteria: