Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: parse options ending with 3+ hyphens #434

Merged
merged 6 commits into from Jul 5, 2022
Merged

Conversation

0x2b3bfa0
Copy link
Contributor

Options ending with three or more hyphens were being parsed as positional arguments because the options without key name regular expression didn't have a ^ beginning anchor.

Before this commit, options ending with three or more hyphens were
being parsed as positional arguments, because a regular expression
didn't have a start anchor.

Closes yargs#433
lib/yargs-parser.ts Show resolved Hide resolved
@0x2b3bfa0 0x2b3bfa0 requested a review from bcoe February 27, 2022 20:24
@0x2b3bfa0

This comment was marked as outdated.

@bcoe
Copy link
Member

bcoe commented Jun 5, 2022

@0x2b3bfa0 this fix looks good to me, but I believe you've created your PR against the branch yargs:main rather than main, mind switching the branch you've created your pull against?

@0x2b3bfa0
Copy link
Contributor Author

0x2b3bfa0 commented Jun 5, 2022

@bcoe, yargs:main means “the branch main under the yargs user or organization” as opposed to 0x2b3bfa0:main, which means “the branch main under the 0x2b3bfa0 user's fork” 🤔

It looks like this pull request should be safe to merge (?)

@0x2b3bfa0
Copy link
Contributor Author

Continuous integration checks are red. Is it my fault, or just a transient issue? 🤔

@bcoe
Copy link
Member

bcoe commented Jun 20, 2022

@0x2b3bfa0 It's not immediately clear to me what the regression might be, it might not be related to your code changes -- unfortunately it might be a little while until I can fix up tests.

Apologies for the delay on review.

@0x2b3bfa0
Copy link
Contributor Author

@bcoe, #442 fixes the tests

@bcoe bcoe merged commit 4f1060b into yargs:main Jul 5, 2022
@bcoe
Copy link
Member

bcoe commented Jul 5, 2022

@0x2b3bfa0 thank you for the patch 🥳 apologies for the slow turn around.

@0x2b3bfa0
Copy link
Contributor Author

Thank you very much!

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.

Option with three or more trailing hyphens parsed as positional argument
2 participants