Skip to content

Support attribute of array of FileInfo or DirectoryInfo #385

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

Conversation

WojciechNagorski
Copy link
Contributor

In this PR I would like to support validation of:

new Argument<FileInfo[]>
                {
                    Arity = ArgumentArity.ZeroOrMore
                }.ExistingOnly()

and

new Argument<DirectoryInfo[]>
                    {
                        Arity = ArgumentArity.ZeroOrMore
                    }.ExistingOnly()

I validate until I find the first error. If you want, I can always validate all values.

Thanks to this PR you can pass:
--paths file1.txt file2.txt

I want to use this feature in BenchmarkDotNet in dotnet/BenchmarkDotNet#1016. Currently It has:
https://github.com/dotnet/BenchmarkDotNet/blob/adde64cbbcde01938d6b2772066852c4f6c0e88d/src/BenchmarkDotNet/ConsoleArguments/CommandLineOptions.cs#L80-L81

@jonsequitur jonsequitur merged commit 2b6c793 into dotnet:master Jan 23, 2019
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