-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[chip-tool] Returns an error if an unknown argument is passed to the … #24875
[chip-tool] Returns an error if an unknown argument is passed to the … #24875
Conversation
…json argument decoder
PR #24875: Size comparison from 5c8ae45 to 535e413 Increases (6 builds for bl602, esp32, linux, nrfconnect, telink)
Decreases (11 builds for bl602, bl702, cyw30739, efr32, esp32, psoc6, qpg, telink)
Full report (42 builds for bl602, bl702, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
auto optionalArguments = GetArgumentsFromJson(command, jsonArguments, true /* addOptional */); | ||
std::vector<std::string> mandatoryArguments; | ||
std::vector<std::string> optionalArguments; | ||
VerifyOrReturnValue(GetArgumentsFromJson(command, jsonArguments, false /* addOptional */, mandatoryArguments), false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for this PR, but eventually we may want to consider that boolean is often not ideal in mixed arguments ... since you have to specify addOptional
anyway for readability, we could enum this to OptionalArguments::kInclude / OptionalArguments::kSkip
or similar.
…json argument decoder (project-chip#24875)
…json argument decoder
Problem
While working on #24831 I realised that I mistyped the
event-min
optional attribute in thechip-tool
version of the adapter. I was usingmin-event
.chip-tool
was silently ignoring this parameter.This PR ensure the parsing fails if not all arguments are consumed.