-
Notifications
You must be signed in to change notification settings - Fork 330
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
List valid options in error messages #382
Conversation
@swift-ci Please test |
Not holding any strong opinions about the specific wording. Suggestions welcome. |
This is great, @dduan! I want to make sure this doesn't fall apart if What do you think of this for the output?
|
nit: for array arguments with non-empty |
I've considered this suggestion and found it confusing in context.
IMO it's more accurate to suggest alternatives for a singular value, namely, the attempted value from the user's input. |
When an option value fails to parse, no custom error message is provided, and a list of valid candidate values is available, include the list as part of the error message. Addresses apple#344.
4622806
to
8a339af
Compare
8a339af
to
e2cd3f3
Compare
@swift-ci test |
I've implemented @natecook1000's suggestion. |
enum Name: String, Equatable, Decodable, ExpressibleByArgument, CaseIterable { | ||
case bruce | ||
case clint | ||
case hulk |
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.
Error: duplicate case detected
😜
Looks great, thanks @dduan! |
When an option value fails to parse, no custom error message is
provided, and a list of valid candidate values is available, include the
list as part of the error message.
Addresses #344.
Checklist