Skip to content

fix: do not treat option value 1 as a count increment - #548

Closed
official-burak wants to merge 1 commit into
yargs:mainfrom
official-burak:fix/value-one-not-count-increment
Closed

official-burak wants to merge 1 commit into
yargs:mainfrom
official-burak:fix/value-one-not-count-increment

Conversation

@official-burak

Copy link
Copy Markdown

Fixes #506.

parser("-x 3 -x 1") currently returns { x: 4 } because setKey treats any value of 1 as a count step (value === increment(), and increment() returns 1). Count flags now use a unique sentinel instead of the number 1.

-x 3 -x 1 is now [3, 1]. With duplicate-arguments-array: false the last value stays 1. Existing count tests still pass.

@shadowspawn

Copy link
Copy Markdown
Member

This looks like a drive-by AI contribution. The account created 29 other Pull Requests in 12 days.

This may get looked at and used when the issue is prioritised.

The human maintainer does not have time to review all AI heavy PRs that are opened.

@official-burak

Copy link
Copy Markdown
Author

This looks like a drive-by AI contribution. The account created 29 other Pull Requests in 12 days.

This may get looked at and used when the issue is prioritised.

The human maintainer does not have time to review all AI heavy PRs that are opened.

Thanks for your feedback. I focus on AI-Native development, so I heavily utilize AI in my coding processes. However, I stand behind the code I submit and believe it adds value to the project.

I completely understand the time constraints human maintainers face. I respect your decision to close this PR; feel free to revisit it whenever the issue is prioritized.

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.

Multiple arguments are incremented if they are equal to 1.

2 participants