Repository navigation
Conversation
When a value-taking option was the last argument, "shift 2" failed without a shift, and the argument loop ran forever. Examples are "ldd-detect.sh --root" and "ldd-scope.sh --out". Both scripts now check for the value before the shift. A missing value stops the script with "<option> needs a value" and exit 2, the documented usage error. This covers ldd-detect's --files, --root, --rules, --cap, --glob and --test-re, and ldd-scope's --root, --out, --max-lines, --glob, --test-re, --lang and --base. Each option has a matrix case that runs the script under a 5-second bound, so a regression fails the case and does not hang CI. Every case fails on the previous scripts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
buzzdan
force-pushed
the
claude/option-value-guard
branch
from
October 18, 2026 19:18
f3c3064 to
f4b908b
Compare
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.
What
ldd-detect.shandldd-scope.shlooped forever when a value-taking option was the last argument. Two examples areldd-detect.sh --rootandldd-scope.sh --out. The cause wasshift 2, which fails without a shift when one argument is left. The argument loop then saw the same option again.Both scripts now check for the value before the shift. A missing value stops the script with
<option> needs a valueand exit 2, the documented usage error.ldd-detect.sh--files,--root,--rules,--cap,--glob,--test-reldd-scope.sh--root,--out,--max-lines,--glob,--test-re,--lang,--baseA Copilot review found the same bug in the gap linter on #100, and that PR fixes it there in the same way.
Changes
core/scripts/ldd-detect.shandcore/scripts/ldd-scope.sh: avaluecheck before eachshift 2.Fixedentry underUnreleased.Checks
task check,task lint-coreandtask docs:checkpass.ldd-detect_test.shandldd-scope_test.shpass for all four plugins.🤖 Generated with Claude Code