Skip to content

Display possible option values in help #594

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 1 commit into from
Nov 14, 2023
Merged

Conversation

rauhul
Copy link
Contributor

@rauhul rauhul commented Nov 7, 2023

Updates HelpGenerator to print possible value options as a suffix to the
user defined help string. In practice this looks like:

Set diagnostic level to report public declarations without an
availability attribute. (values: error, warn, ignore; default: warn)

@rauhul rauhul force-pushed the all-values-in-help branch 3 times, most recently from c8ec27d to e699a93 Compare November 8, 2023 01:17
@rauhul
Copy link
Contributor Author

rauhul commented Nov 8, 2023

@swift-ci please test

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.

This looks great! I'm a little concerned about how this will affect the help when a CaseIterable type has a large number of values. Can we update the allValueStrings documentation to show how to suppress/limit that number, or would it make sense to provide a configuration property to ArgumentHelp? (e.g. maxCaseDisplay)

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.

Updated docs look great! Added some light editing through the comments, then we can merge 👍🏻

@rauhul
Copy link
Contributor Author

rauhul commented Nov 14, 2023

@swift-ci please test

Updates HelpGenerator to print possible value options as a suffix to the
user defined help string. In practice this looks like:

> Set diagnostic level to report public declarations without an
> availability attribute. (values: error, warn, ignore; default: warn)
@rauhul rauhul force-pushed the all-values-in-help branch from eb4bff4 to cffff99 Compare November 14, 2023 17:04
@rauhul
Copy link
Contributor Author

rauhul commented Nov 14, 2023

@swift-ci please test

@natecook1000 natecook1000 enabled auto-merge (squash) November 14, 2023 17:08
@natecook1000 natecook1000 merged commit 75dae3d into main Nov 14, 2023
@natecook1000 natecook1000 deleted the all-values-in-help branch November 14, 2023 17:30
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