Skip to content

Display possible option values in help#594

Merged
natecook1000 merged 1 commit into
mainfrom
all-values-in-help
Nov 14, 2023
Merged

Display possible option values in help#594
natecook1000 merged 1 commit into
mainfrom
all-values-in-help

Conversation

@rauhul
Copy link
Copy Markdown
Collaborator

@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
Copy Markdown
Collaborator Author

rauhul commented Nov 8, 2023

@swift-ci please test

Copy link
Copy Markdown
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
Copy Markdown
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 👍🏻

Comment thread Sources/ArgumentParser/Documentation.docc/Articles/CustomizingHelp.md Outdated
Comment thread Sources/ArgumentParser/Documentation.docc/Articles/CustomizingHelp.md Outdated
Comment thread Sources/ArgumentParser/Documentation.docc/Articles/CustomizingHelp.md Outdated
Comment thread Sources/ArgumentParser/Documentation.docc/Articles/CustomizingHelp.md Outdated
Comment thread Sources/ArgumentParser/Documentation.docc/Articles/CustomizingHelp.md Outdated
Comment thread Sources/ArgumentParser/Parsable Types/ExpressibleByArgument.swift Outdated
Comment thread Sources/ArgumentParser/Documentation.docc/Articles/CustomizingHelp.md Outdated
@rauhul
Copy link
Copy Markdown
Collaborator 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
Copy Markdown
Collaborator 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