Repository navigation
fix: reject missing CLI option values - #4
Draft
1932819331hy-debug wants to merge 1 commit into
Draft
1932819331hy-debug wants to merge 1 commit into
1932819331hy-debug wants to merge 1 commit into
Conversation
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
Reject a following
--optiontoken where an option requires a value. This keeps a missing value in the README's bad-argument category instead of reporting an unreachable endpoint. Single-dash numeric values still reach numeric validation; normal--helpand explicit RPC URLs retain their behavior.Compatibility note: normal
--helpstill exits 0. When help is combined with a newly recognized missing value, such as--help ... --rpc --json, argument parsing now reports exit 2 before displaying help; this combination previously exited 0.The change is one parser condition plus six CLI subprocess tests. It does not change the RPC client, schedule calculations, or Action script.
Evidence
13184ff111532c172f37d54d59f00e7eea6b9a23have three passes and three assertion failures. Missing--rpcvalues before--json,--help, and--unknowneach return 3 instead of 2.After: all six pass;
npm testpasses 29/29, including the 23 existing tests.--json, and incorrectly rejecting single-dash numeric values.127.0.0.1. Main and candidate each pass 11 checks covering JSON/text output, exit codes 0/1/2/3, Action outputs and summary, andfail-on-drift=falsepreserving argument/endpoint failures. Corresponding output files are unchanged.All execution used Node 24.22.1. The Action checks supply its environment directly; they do not run GitHub expression interpolation or a hosted runner. Node 18/20/22, other operating systems, npx installation, real RPC providers, and hosted CI remain unverified. No dependencies were added; build, lint, and typecheck scripts are not configured.
AI assistance was used for implementation, testing, and independent review. This is a source-backed CLI contract repair, not completion of a separate maintainer issue.
Merge Danger
Door: Two-way. A localized parser correction with no migration.
Blast Radius: CLI.
A missing option value followed by another long option now exits 2 before attempting RPC access, including when
--helpis also present. Valid URLs and numeric values are unchanged.