Skip to content

Fix parsing of empty long option values - #959

Open
actuallyhrishikesh wants to merge 1 commit into
apple:mainfrom
actuallyhrishikesh:fix-empty-long-option-value
Open

Fix parsing of empty long option values#959
actuallyhrishikesh wants to merge 1 commit into
apple:mainfrom
actuallyhrishikesh:fix-empty-long-option-value

Conversation

@actuallyhrishikesh

Copy link
Copy Markdown

Fixes #958.

This change treats the presence of = in a long option as an explicit attached value, including empty values.

For example:

--output=

is now parsed as an option with an empty string value rather than being treated as a bare flag.

Tests:

  • Added tokenizer coverage for empty long option values.
  • Added an end-to-end regression test for --output=.
  • Ran the full test suite and formatting checks.

Compatibility note: --flag= is now treated as a flag with an explicit empty attached value, consistent with the existing single-dash -f= behavior and the issue's explicit = rule.

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.

--opt= silently collapses to a bare flag and consumes the following token (short -o= behaves differently)

1 participant