Skip to content

fix: support single-dash boolean negation without short option groups - #558

Closed
zanmlakar wants to merge 1 commit into
yargs:mainfrom
zanmlakar:fix/single-dash-negation
Closed

zanmlakar wants to merge 1 commit into
yargs:mainfrom
zanmlakar:fix/single-dash-negation

Conversation

@zanmlakar

Copy link
Copy Markdown

When short-option-groups is false, -no-window currently creates a no-window
option instead of negating window. Recognize the configured negation prefix
after either one or two dashes in that mode, using the existing shared matcher
for parsing and unknown-option recognition.

The default grouped-short-option behavior is preserved. Tests cover custom
prefixes, aliases, arrays, unknown options, and disabled boolean negation.

Fixes #468

Validation: three regression cases failed before the fix. npm test passes all
367 tests, npm run check passes, npm run test:typescript passes 20 tests, and
npm run coverage passes after the main test suite (99.53% lines/statements,
97.24% branches). Deno passes 8 tests. Chromium passes two existing browser
fixture cases plus the new regression using an isolated local port; the stock
browser command could not use port 8080 because another workspace service owns it.

AI assistance: researched and implemented with OpenAI Codex (gpt-6.1-sol),
with independent review by another Codex agent. No human code review or certification is claimed.

@shadowspawn

Copy link
Copy Markdown
Member

This is a drive-by AI contribution.

This may get looked at and used when the issue is prioritised.

The human maintainer does not have time to review all AI heavy PRs that are opened.

For more, see: yargs/yargs#2606

@shadowspawn shadowspawn closed this Oct 7, 2026
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.

negation-prefix does not work with short-option-groups

2 participants