-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…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.
CaseIterable
to auto-generate CLI --help
entries
MaxDesiatov
reviewed
Oct 15, 2024
MaxDesiatov
approved these changes
Oct 15, 2024
plemarquand
reviewed
Oct 15, 2024
Co-authored-by: Max Desiatov <[email protected]>
@swift-ci test |
jakepetroules
approved these changes
Oct 16, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.