Skip to content

Use CaseIterable to auto-generate CLI --help entries #8045

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 16, 2024

Conversation

cmcgee1024
Copy link
Member

The swift-argument-parser library will automatically show the available values for options that implement the CaseIterable protocol. There are options in SwiftPM that do either list the available values statically in the help message, which can be stale, or don't provide a list at all, which leaves the user to guess the value that they want. Sweep these options, removing the static list, sometimes adding the help message based on the swift documentation. Since the CaseIterable doesn't provide a description of each value, leave the options alone that provide detail for each of their available values.

The result of these changes is that the online help (and content assist) is able to automatically display all of the available values for certain options. Also, some of the options have a help description for the first time.

…ilable values

The swift-argument-parser library will automatically show the available values
for options that implement the CaseIterable protocol. There are options in SwiftPM
that do either list the available values statically in the help message, which can
be stale, or don't provide a list at all, which leaves the user to guess the value
that they want. Sweep these options, removing the static list, sometimes adding
the help message based on the swift documentation. Since the CaseIterable doesn't
provide a description of each value, leave the options alone that provide detail
for each of their available values.
@MaxDesiatov MaxDesiatov changed the title Sweep enumable options and use CaseIterable to automate help with available values Use CaseIterable to auto-generate CLI --help entries Oct 15, 2024
@MaxDesiatov
Copy link
Contributor

@swift-ci test

Copy link
Contributor

@jakepetroules jakepetroules left a comment

Choose a reason for hiding this comment

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

Nice!

@rauhul rauhul merged commit d28f725 into swiftlang:main Oct 16, 2024
5 checks passed
plemarquand added a commit to plemarquand/swift-package-manager that referenced this pull request Oct 17, 2024
Follow on to swiftlang#8045 to make the completion-list tool use the CaseIterable
support in swift-argument-parser to automatically enumerate the options.

`list-snippets` was missing from the list, and is now added.
plemarquand added a commit that referenced this pull request Oct 17, 2024
Follow on to #8045 to make the completion-list tool use the CaseIterable
support in swift-argument-parser to automatically enumerate the options.

`list-snippets` was missing from the list, and is now added.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants