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

Invalid parsing of muliple short arguments followed by assigment #2

Open
maxmuen opened this issue Jan 27, 2021 · 0 comments
Open

Invalid parsing of muliple short arguments followed by assigment #2

maxmuen opened this issue Jan 27, 2021 · 0 comments

Comments

@maxmuen
Copy link

maxmuen commented Jan 27, 2021

The parser failes to handle the corner case where multiple short argument have an assigned at the end.

# broken behavior
$ deno run https://deno.land/x/deno_minimist@v1.0.2/examples/parse.ts -abc=def
{ _: [], a: "def" }

# multiple assignments really confuse the parser
$ deno run https://deno.land/x/deno_minimist@v1.0.2/examples/parse.ts -abc=d=e=f
{ _: [], a: "d" }

# the arguments separated out, gives the correct behavior.
$ deno run https://deno.land/x/deno_minimist@v1.0.2/examples/parse.ts -a -b -c=def
{ _: [], a: true, b: true, c: "def" }

#  even with the arguments separated out, the parser fails to account for multiple = characters.
$ deno run https://deno.land/x/deno_minimist@v1.0.2/examples/parse.ts -a -b -c=d=e=f
{ _: [], a: true, b: true, c: "d" }
$ deno run https://deno.land/x/deno_minimist@v1.0.2/examples/parse.ts -a -b -c==def
{ _: [], a: true, b: true, c: "" }
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

No branches or pull requests

1 participant