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

Repeated occurence of = isnt handled correctly #5

Closed
nhz-io opened this issue Oct 15, 2022 · 1 comment · Fixed by #6
Closed

Repeated occurence of = isnt handled correctly #5

nhz-io opened this issue Oct 15, 2022 · 1 comment · Fixed by #6

Comments

@nhz-io
Copy link
Contributor

nhz-io commented Oct 15, 2022

minimist doesn't handle correctly:

-a=b=c
{ _: [], a: 'b' }

yargs-parser does handle correctly

-a=b=c
{ _: [], a: 'b=c' }

Spawned from: #2 (comment)

@shadowspawn
Copy link
Collaborator

I think there are two bugs in this area of the code. The code is looking for an = but not restricting test to just the start of the argument, then assumes there is only one = when assigning the option value.

So the second bug is with -ab=c the b is getting ignored.

if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) {

setArg(letters[j], next.split('=')[1], arg);

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 a pull request may close this issue.

2 participants