Custom Argument Validation

Sep 5, 2012 at 9:26 AM
Edited Sep 5, 2012 at 9:26 AM

Hello,

First of all thanks for your great library.

I'd like to suggest a feature:

In my Application i have a FileArgument. The FileArgumentAttribute works great and the FileMustExist Property is of great help. But i need further validation.

First of all i have to check the file extension. This is not quite a difficult to realize. The second check i have to do is the version of the provided file. To make it short. In my case i can write a custom argument and that's not realy heavy to relize. But it would probably easier if the Argument class has a validation delegate that is invoked on argument parsing. I could also write a custom argument with the mentioned validation delgate but maybe its a feature you can think of for your next release?

Coordinator
Feb 21, 2016 at 9:46 PM
We expected that you would create your own argument class (probably derived from FileArgument) in such cases. But providing something general kind of handler-based validation is an interesting idea and I will consider it for the next version. I've created an issue for this https://github.com/j-maly/CommandLineParser/issues/11.

The project has been migrated to GitHub, please use it for tracking the project, getting information about new releases & reporting all potential issues.