Skip to content

Conversation

@bob-wilson
Copy link
Contributor

The visibility of OptionGroups is ignored if they are nested inside another OptionGroup. Instead of trying to filter groups when creating an ArgumentSet, use the OptionGroup's visibility to modify the arguments within the group.

Checklist

  • I've added at least one test that validates that my change is working, if appropriate
  • I've followed the code style of the rest of the project
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary

Copy link
Member

@natecook1000 natecook1000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this fix, @bob-wilson! Just a note about the tests; otherwise, this looks great to merge.

Comment on lines 197 to 206
@OptionGroup(visibility: .hidden)
var flagsAndOptions: FlagsAndOptions

@OptionGroup(visibility: .private)
var argsAndFlags: ArgsAndFlags
@OptionGroup()
var nested: NestedGroups
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for completeness it would be best to keep this existing type and add a new NestedHiddenGroups/testNestedHiddenGroups() type/test function pair.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, sure. I changed it as you suggested.

The visibility of OptionGroups is ignored if they are nested inside another
OptionGroup. Instead of trying to filter groups when creating an ArgumentSet,
use the OptionGroup's visibility to modify the arguments within the group.
@bob-wilson bob-wilson force-pushed the nested-group-visibility branch from 100aeb0 to 4315849 Compare December 18, 2025 18:14
@bob-wilson bob-wilson merged commit d56133d into apple:main Dec 18, 2025
29 checks passed
@bob-wilson bob-wilson deleted the nested-group-visibility branch December 18, 2025 18:36
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.

2 participants