Skip to content

Fix #2407 when @ArgGroup is reused#2508

Open
loosebazooka wants to merge 1 commit intoremkop:mainfrom
loosebazooka:fix2407
Open

Fix #2407 when @ArgGroup is reused#2508
loosebazooka wants to merge 1 commit intoremkop:mainfrom
loosebazooka:fix2407

Conversation

@loosebazooka
Copy link
Copy Markdown

@loosebazooka loosebazooka commented Mar 5, 2026

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>
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

2 participants