Skip to content

fix: reject missing CLI option values - #4

Draft
1932819331hy-debug wants to merge 1 commit into
workolic:mainfrom
1932819331hy-debug:fix/cli-missing-option-values
Draft

1932819331hy-debug wants to merge 1 commit into
workolic:mainfrom
1932819331hy-debug:fix/cli-missing-option-values

Conversation

@1932819331hy-debug

Copy link
Copy Markdown

Summary

 --rpc --json
- treat --json as the RPC URL, retry, and exit 3
+ report the missing --rpc value and exit 2

Reject a following --option token 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 --help and explicit RPC URLs retain their behavior.

Compatibility note: normal --help still 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

  • Before: the six new tests on main 13184ff111532c172f37d54d59f00e7eea6b9a23 have three passes and three assertion failures. Missing --rpc values before --json, --help, and --unknown each return 3 instead of 2.
    After: all six pass; npm test passes 29/29, including the 23 existing tests.
  • Independent AI-assisted review reproduced the same RED result and reran all 29 native tests successfully. Its separate parameter and complete Action-shell comparison checked 54 expected outcomes across main and candidate; these are not 54 additional native tests. No blocking finding remained in this scoped local review.
  • Two deliberately broken parser variants are detected: recognizing only --json, and incorrectly rejecting single-dash numeric values.
  • A separate local harness runs the real CLI and the unchanged composite Action's shell block against synthetic HTTP on 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, and fail-on-drift=false preserving 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 --help is also present. Valid URLs and numeric values are unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant