Skip to content

fix: preserve arguments after explicitly empty values - #34

Open
feritcemkahraman wants to merge 1 commit into
lukeed:masterfrom
feritcemkahraman:fix/empty-assigned-values
Open

feritcemkahraman wants to merge 1 commit into
lukeed:masterfrom
feritcemkahraman:fix/empty-assigned-values

Conversation

@feritcemkahraman

Copy link
Copy Markdown

An explicitly empty assignment currently falls through to consuming the next argument. For example, parsing --name= file.txt with name configured as a string produces name: "file.txt" and loses the positional filename.

Distinguish a present = from an absent assignment so the empty string remains the option value and the following argument is parsed independently. Cover both long and short options, plus an empty assignment followed by another flag.

Validation: the regressions reproduce two failures before the fix. npm test runs the build and all 87 assertions pass after it.

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.

1 participant