commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian A. Egge" <briane...@yahoo.com>
Subject Re: [CLI] CLI Validation - Was: WELCOME to dev@commons.apache.org
Date Tue, 14 Aug 2007 22:44:31 GMT
Hi Wolfgang,

I agree that the framework should have better support for groups and mutually exclusive options.
 This is a feature I've often had to do in a pre or post processing step.  

I've thought about writing a CLI library which would accept a EBNF option grammar, much like
JavaCC or ANTLR.  You could do the validation, and assign actions to options or commands.
 A simple grammar would be easier to specify the arguments than a *Builder object.  Realistically,
though, I know I don't have the time to take on such a project, so my best bet it to improve
on one of the existing projects.

I should have some time in the next few weeks to get some fixes into CLI 2.x, and look at
ways of making it do smarter validation.

-Brian

Wolfgang Roessler <contact@roessler-wolfgang.de> wrote: Hi Hen,

the Commons Validator package sounds interesting and I perhaps it should 
be possible to use these validators. But I also like the CLI2 validators 
for files and directories. The validators I am missing are something 
like dependency-validators, e.g. specify mutually exclusive options. 
Groups offer very little support for this.

Currently validation and parsing is mixed up I think. This way if I pass 
a filename and the file should be writable but it isn't, I get an error 
that the option is missing and not, that there is a problem with the 
specified file. Perhaps this should be separated in a FileOption and the 
validator.

In my opinion the target of CLI2 should be, that all parsing and 
validation is performed by the framework.

Wolfgang


Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message