Skip to content

feat(W-19992287): support the 'combinable' & 'only' flag relationships (#1487)#1488

Merged
mdonnalley merged 1 commit intomainfrom
mdonnalley/1487
Oct 20, 2025
Merged

feat(W-19992287): support the 'combinable' & 'only' flag relationships (#1487)#1488
mdonnalley merged 1 commit intomainfrom
mdonnalley/1487

Conversation

@mdonnalley
Copy link
Contributor

Merges #1487
@W-19992287@

This new flag relationship aims to ease defining that a specific flag is ONLY compatible
with just a few other ones.
Currently users would have to enumerate all other incompatible flags in the exclusive relationship,
which leads to some repetition, doesn't capture exactly the original intention, and could lead to
oversights if more flags are added to that command later.
I realized this use case while working on a balena-cli PR, where we had to define that
 --config is allowed to be combined with the --yes flag and is incompatible with all other flags.
The workaround that we ended up having to use, was to use an IIFE and define the compatible flags
in a separate array and reference that in the exclusive property.
balena-io/balena-cli@692e70d
@mdonnalley mdonnalley merged commit d13b448 into main Oct 20, 2025
84 of 86 checks passed
@mdonnalley mdonnalley deleted the mdonnalley/1487 branch October 20, 2025 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants