Open
Conversation
parseArgs() now rejects unknown parameter keys with a clear error instead of silently accepting them. Added -se (single dash) as a recognized boolean flag alongside --se, matching the help text. Both -se and --se continue to work for backwards compatibility. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
parseArgs()now validates parameter keys against a known set and throwsIllegalArgumentExceptionfor unknown keys (e.g., typo--reportFileinstead of--reportFiles)-se(single dash) as a recognized boolean flag alongside--seand--systemErrors, matching what the help text documents-seand--sework for backwards compatibilityContext
Since the initial commit (c71ed1f, 2021-11-15),
parseArgs()accepted any--key=valuewithout checking if the key was known. A typo like--reportFile=foo.xml(missing 's') would be silently stored, then the user would get a confusing "Parameter --reportFiles or -rf is missing" error with no hint about the typo.Additionally, the help text documented
-se(single dash) as the short form for--systemErrors, but the code only recognized--se(double dash). A user typing-seper the help would getSystem.exit(1).Verification
--reportFile,--bogus) are rejected withIllegalArgumentException-seworks as a bare boolean flag (like--se)--sestill works for backwards compatibility