Skip to content

Fix Issue #2385#2386

Open
BrandonIrizarry wants to merge 2 commits into
urfave:mainfrom
BrandonIrizarry:bci
Open

Fix Issue #2385#2386
BrandonIrizarry wants to merge 2 commits into
urfave:mainfrom
BrandonIrizarry:bci

Conversation

@BrandonIrizarry

Copy link
Copy Markdown

What type of PR is this?

bugfix

  • bug

What this PR does / why we need it:

Mutual exclusion wasn't being properly enforced when using MutuallyExclusiveFlags.

flag_mutex_test.go

  • Introduce a breaking test that illustrates the bug.

flag_mutex.go

  • Rewrite function check to pass the breaking test.

Which issue(s) this PR fixes:

Fixes #2385

Testing

I ran make test at the project root.

Release Notes

(REQUIRED)

NONE

This intentionally creates a failing test. We're trying to prove that,
if we have mutually exclusive flags that look like:

{ { A, B }, { C, D } }

It should be the case that any combination that draws from both sets
should result in an error. However, currently this isn't the case; for
example, the code considers the combination "--A --D" to be legal.
@BrandonIrizarry BrandonIrizarry requested a review from a team as a code owner July 8, 2026 02:26
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.

MutuallyExclusiveFlags doesn't enforce full mutual exclusion

1 participant