swift-argument-parser icon indicating copy to clipboard operation
swift-argument-parser copied to clipboard

`title` argument passed to nested `@OptionGroup` has no effect

Open MaxDesiatov opened this issue 1 year ago • 1 comments

@OptionGroup behaves in an unexpected way with nested groups when title: argument value is specified.

ArgumentParser version: 1.2.2 Swift version: swift-driver version: 1.62.15 Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51) Target: arm64-apple-macosx13.0

Checklist

  • [x] If possible, I've reproduced the issue using the main branch of this package
  • [x] I've searched for existing GitHub issues

Steps to Reproduce

Create a type that has properties using @OptionGroup property wrapper with title: argument passed. Uses this type then as @OptionGroup itself. This top level may specify or not specify its own title: argument, this doesn't make a difference on the observed outcome.

Expected behavior

Nested @OptionGroups have their title: values displayed and options grouped by these titles in help output.

Actual behavior

Nested @OptionGroups don't have their title: values displayed and options grouped by these titles in help output. All of the options are displayed within the top-level group, title: values on nested groups have no effect whatsoever.

MaxDesiatov avatar Mar 01 '23 15:03 MaxDesiatov