fix(cli): prevent --log-level=value from swallowing next argument#6144
Open
LikiosSedo wants to merge 2 commits intoEffect-TS:mainfrom
Open
fix(cli): prevent --log-level=value from swallowing next argument#6144LikiosSedo wants to merge 2 commits intoEffect-TS:mainfrom
LikiosSedo wants to merge 2 commits intoEffect-TS:mainfrom
Conversation
When using equals syntax (--log-level=debug), the argument filter incorrectly skips the next argument because isLogLevelArg() matches the combined form. Only skip the next arg when the previous arg is exactly "--log-level" (space-separated syntax). Fixes Effect-TS#6103
🦋 Changeset detectedLatest commit: e8d3e86 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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
When using
--log-level=debug(equals syntax), theSetLogLevelhandler incorrectly strips the next argument too.Root Cause
The argument filter loop checks
isLogLevelArg(args[i - 1]), which matches the combined form--log-level=debug. This causes the argument ati(the one after the log-level flag) to be skipped.Fix
Change the look-back check from
isLogLevelArg(args[i - 1])toargs[i - 1] === "--log-level". This ensures only the space-separated value (e.g.debugafter--log-level debug) is skipped, not the argument following a combined--log-level=valueform.Reproduction
Fixes #6103