Skip to content

Make @OptionGroup(visibility:) a public API#419

Merged
natecook1000 merged 1 commit intomainfrom
nate/optiongroup_vis
Mar 15, 2022
Merged

Make @OptionGroup(visibility:) a public API#419
natecook1000 merged 1 commit intomainfrom
nate/optiongroup_vis

Conversation

@natecook1000
Copy link
Copy Markdown
Member

@natecook1000 natecook1000 commented Mar 15, 2022

Description

This removes the underscore from the parameter in @OptionGroup(visibility:), making it a fully public API. This allows users to set the visibility for an entire option group at once.

Detailed Design

This adds a single initializer to the OptionGroup type.

extension OptionGroup {
    init(visibility: ArgumentVisibility)
}

Documentation Plan

Symbol documentation included.

Test Plan

Updated tests for generating help.

Source Impact

This deprecates, but doesn't remove, the no argument OptionGroup initializer.

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

@natecook1000
Copy link
Copy Markdown
Member Author

@swift-ci Please test

@natecook1000 natecook1000 force-pushed the nate/optiongroup_vis branch from d9cf7ba to 82371ba Compare March 15, 2022 04:21
@natecook1000
Copy link
Copy Markdown
Member Author

@swift-ci Please test

@natecook1000 natecook1000 merged commit d7a5a79 into main Mar 15, 2022
@natecook1000 natecook1000 deleted the nate/optiongroup_vis branch March 15, 2022 04:51
leuski pushed a commit to leuski/swift-argument-parser that referenced this pull request Jun 17, 2022
* 'main' of github.com:apple/swift-argument-parser: (114 commits)
  Fix `AsyncParseableCommand` hierarchy (apple#436)
  Add experimental manual page generation (apple#332)
  Improving edit distance string extension (apple#446)
  List valid options in error messages for enum array argument (apple#445)
  Remove LinuxMain.swift (apple#367)
  Hide hidden subcommands from completions (apple#443)
  Update changelog for 1.1.2 release (apple#441)
  Fix error message for @option array without values (apple#435)
  Fix Repeat's endless printing (apple#437)
  build: statically link ArgumentParserToolInfo always (apple#424)
  Update changelog for the 1.1.1 release (apple#428)
  build: complete the changes from apple#423 (apple#425)
  Remove platform requirement from Package.swift (apple#427)
  build: repair the build after apple#404 (apple#423)
  Fix broken links/incorrect variance calculation (apple#422)
  Update changelog for the 1.1.0 release (apple#421)
  Update documentation (apple#420)
  Make `@OptionGroup(visibility:)` a public API (apple#419)
  Support an `async` entry point for commands (apple#404)
  Fix a typo and template links (apple#418)
  ...
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.

1 participant