Skip to content
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

Add ParseResult.ValueForArgument and ValueForOption #949

Merged
merged 7 commits into from
Jul 2, 2020

Conversation

jonsequitur
Copy link
Contributor

@jonsequitur jonsequitur commented Jun 26, 2020

This aims to further simplify looking up values from a ParseResult.

@jonsequitur jonsequitur requested a review from Keboo June 29, 2020 15:25
public T ValueForArgument<T>(Argument<T> argument)
{
if (FindResultFor(argument) is {} result &&
result.GetValueOrDefault<T>() is {} t)
Copy link
Member

Choose a reason for hiding this comment

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

nit: We are not being consistent with the spacing on the pattern {} vs { }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Formatting consistency is something we might want to set up globally and enforce with dotnet-format.

@jonsequitur jonsequitur changed the title [WIP] Add ParseResult.ValueForArgument and ValueForOption Add ParseResult.ValueForArgument and ValueForOption Jul 2, 2020
@jonsequitur jonsequitur merged commit efc6127 into dotnet:master Jul 2, 2020
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