fix(util): align parseArgs option parsing#3495
Merged
proggeramlug merged 1 commit intoMay 31, 2026
Merged
Conversation
This was referenced May 31, 2026
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.
Closes #3015
Closes #3017
Closes #3018
Closes #3019
Closes #3021
Summary
node:util.parseArgs()descriptor handling formultiplearrays anddefaultvalues, including default type validation.config.argsfromprocess.argv.slice(2)and preserves non-string argv values for positionals/tokens while rejecting non-string option values.strict: false.// parity-argv:fixture hook so default-argv behavior can be tested against Node and Perry with the same CLI arguments.Why Batched
These issues share the same runtime parser state machine and result-shaping code. Fixing them together avoids layering incompatible partial parseArgs behavior across multiple PRs.
Tests Added
test-parity/node-suite/util/parse-args/multiple-defaults.tstest-parity/node-suite/util/parse-args/default-validation.tstest-parity/node-suite/util/parse-args/short-groups-and-unknown.tstest-parity/node-suite/util/parse-args/default-args-and-non-string.tsVerification
PATH=/home/github-runner/actions-runner/externals/node24/bin:$PATH ./run_parity_tests.sh --suite node-suite --module util/parse-args-> 9 pass, 0 fail, 0 compile fail.PATH=/home/github-runner/actions-runner/externals/node24/bin:$PATH ./run_parity_tests.sh --suite node-suite --module util-> 77 pass, 1 existing mismatch (node-suite/util/get-system-error), 0 compile fail.RUSTC_WRAPPER= cargo check -p perry-runtime -p perry-codegen -p perry-hir -p perry-api-manifest -p perry-> passed with existing repository warnings.cargo fmt --all -- --check-> passed.git diff --check && git diff --cached --check-> passed../scripts/check_file_size.sh-> passed.jq empty test-parity/known_failures.json-> passed.Known Limitations
node-suite/util/get-system-error.Non-Goals
node:utilAPIs.