Repository navigation
Exit 1 for a stray argument instead of silently dropping it [patch] - #168
Open
matt-edmondson wants to merge 1 commit into
Open
matt-edmondson wants to merge 1 commit into
matt-edmondson wants to merge 1 commit into
Conversation
CommandLineParser discards any token that no option binds, so an unquoted path with a space (`-o my icons`) wrote to ./my and exited 0. Bind the leftover tokens with a hidden [Value] and reject them in Validate, naming them and pointing at quoting, before any output folder is created. Fixes #167 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW6aQDv4uGsdgeCABoe
Contributor
Author
|
CI is red, and the cause isn't in this PR. All three This is a newly published advisory against ImageSharp 3.1.12. No ready fix exists to port:
Once restore passes on Generated by Claude Code |
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.
Fixes #167
What changed
Argumentsnow binds every token that no option claims to a hidden[Value(0)] Unboundproperty. CommandLineParser 2.9.1 used to drop these tokens without reporting an error.Validaterejects a non-emptyUnboundwithUnexpected argument(s): <tokens>. Quote paths that contain spaces.Executethen exits 1 before it creates any output folder.-i w -o my icons -c red./my, exit 0icons-i w -o x -s 64 3232-i w -o x extraextraTests
ArgumentsTestsgains five tests that parse a real command line the wayMaindoes:the unquoted-path case
a second size
several stray tokens
Executeexits 1 and leaves the output folder uncreateda clean command line still validates
I removed the
Validatecheck and kept the property: four of the new tests failed. With the check back in, all 25ArgumentsTestspass.The full suite gives 85 passed and 8 failed. The 8 failures are
OutputMatchesTheGoldMaster, which fails the same way onmainin this environment because the gold-master PNGs are Git LFS pointers that weren't fetched.Restore on
maincurrently fails with NU1903, a new high-severity advisory against SixLabors.ImageSharp 3.1.12. I ran the suite with-p:NuGetAudit=false. Dependabot PR Bump SixLabors.ImageSharp from 3.1.12 to 3.2.0 #145, which bumps it to 3.2.0, is the fix for that.Generated by Claude Code