Skip to content

Fix #2407 when @ArgGroup is reused - #2508

Merged
remkop merged 2 commits into
remkop:mainfrom
loosebazooka:fix2407
May 5, 2026
Merged

Fix #2407 when @ArgGroup is reused#2508
remkop merged 2 commits into
remkop:mainfrom
loosebazooka:fix2407

Conversation

@loosebazooka

@loosebazooka loosebazooka commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

This change preserves all instances of the same @Arggroup across all commands it is applied to.

fixes #2407


It looks like when an ArgGroup is reused, it is overwritten in argGroupElementsByType when being parsed (but not in argGroupElementsByVar which has actual unique keys). This means when iterating through argGroupElementsByVar later in the process, it hits ArgGroupBuilders that were not fully populated in connectModel() (which iterates over argGroupElementsByType), leading to a failure to fully realize the ArgGroupSpec in its constructor (when args.isEmpty() and subgroups.isEmpty()).

This change preserves all instances of the same @Arggroup across
all commands it is applied to.

Signed-off-by: Appu Goundan <appu@google.com>
@remkop remkop added this to the 4.7.8 milestone May 5, 2026
@remkop
remkop self-requested a review May 5, 2026 08:31
@remkop
remkop merged commit 5c77128 into remkop:main May 5, 2026
36 of 37 checks passed
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.

ArgGroup has no options or positional parameters, and no subgroups since 4.7.7

3 participants