Skip to content

Invalid parsing of muliple short arguments followed by assigment #2

@maxmuen

Description

@maxmuen

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: "" }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions