Repository navigation
feat(cli): read versions from stdin with an explicit dash - #955
Open
AbineshDev01 wants to merge 1 commit into
Open
AbineshDev01 wants to merge 1 commit into
AbineshDev01 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
Add an explicit
-operand to read whitespace-separated versions from stdin:Root cause / design
The CLI only collects versions from argv. Automatically consuming non-TTY stdin, as attempted in the closed #161, would make existing spawned callers wait for stdin to close. This follows the maintainer's suggestion there to require
-instead.Changes
-operand; repeated operands read the stream once, and help still returns immediately.No dependencies, configuration, library APIs, or Node engine requirements change.
Testing
npm test: all 54 test files passed, 100% statement/branch/function/line coverage../node_modules/.bin/tap --no-coverage test/bin/semver.js: passed.npm teston Node v26.13.1: all 54 test files passed with 100% coverage, includingposttestESLint andpostlinttemplate-oss checks.node --check bin/semver.js: passed.git diff --check: passed.npm pack --dry-run: passed (54 packaged files). There is no compilation/build script.The full suite was run on Linux/Node 26, not the full supported runtime/platform matrix. Sorted output intentionally waits for EOF.
Issue reference
Closes #149. Supersedes the abandoned stdin approach in #161 with the explicit opt-in suggested in its review.
AI assistance was used for implementation, testing, and an independent code review.