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

Option with three or more trailing hyphens parsed as positional argument #433

Closed
0x2b3bfa0 opened this issue Feb 3, 2022 · 0 comments · Fixed by #434
Closed

Option with three or more trailing hyphens parsed as positional argument #433

0x2b3bfa0 opened this issue Feb 3, 2022 · 0 comments · Fixed by #434

Comments

@0x2b3bfa0
Copy link
Contributor

0x2b3bfa0 commented Feb 3, 2022

Description

[email protected] and later versions interpret options with three or more trailing hyphens as positional parameters. This issue only happens when options and values are separated with an equal sign.

Actual behavior

> require('yargs-parser')(["--option=---"])
{ _: [ '--option=---' ] }

Desired behavior

> require('yargs-parser')(["--option=---"])
{ _: [], option: '---' }
@bcoe bcoe transferred this issue from yargs/yargs Feb 5, 2022
0x2b3bfa0 added a commit to 0x2b3bfa0/yargs-parser that referenced this issue Feb 5, 2022
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
@bcoe bcoe closed this as completed in #434 Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants