You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "David Leal (JIRA)" <ji...@apache.org> on 2006/09/12 11:56:23 UTC

[jira] Commented: (CLI-125) Invokes Date Validator for a Date type (fail on real example)

    [ http://issues.apache.org/jira/browse/CLI-125?page=comments#action_12434108 ] 
            
David Leal commented on CLI-125:
--------------------------------

I have tested the example, under Java:

C:\Documents and Settings\X017735>java -version
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)

and also under java:

J:\java\jdk\jdk1.4.2_11\bin>java -version
java version "1.4.2_11"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_11-b06)
Java HotSpot(TM) Client VM (build 1.4.2_11-b06, mixed mode)

> Invokes Date Validator for a Date type (fail on real example)
> -------------------------------------------------------------
>
>                 Key: CLI-125
>                 URL: http://issues.apache.org/jira/browse/CLI-125
>             Project: Commons CLI
>          Issue Type: Bug
>    Affects Versions: Nightly Builds
>            Reporter: David Leal
>         Attachments: com.zip, TEST-com.schinvest.lra.business.batch.commandLine.batchCaller.TestBatchCallerCommandLineParser.txt, TestBatchCallerCommandLineParser.java
>
>
> Dear Sr,
> I would like to send a fail I have found when testing my real Command Line Parser example. I have the command line class definition and also the corresponding testing file. (I will try to add an atachment file).
> The file occurs because it miss understand probably som option definition and it try to validate a Date type with a date validator which is wrong. I can't isolate the situation for the moment, but on the testing class you will see exaclty what happend.
> The file occurs with this situation:
> 		args = new String[]{"-holders-options", "-local", "-f", "nada.es",
> 				"-movements-options", "-date", "D-3", "-positions-options",
> 				"-local", "-f", "otroNada.txt", "all"};
> 		parser.parse(args);
> but with this:
> 		args = new String[]{"-holders-options", "-local", "-f", "nada.es",
> 				"-movements-options", "-date", "D-3", "holders", "movements"};
> 		parser.parse(args);
> it doesn't happend. The -movements-options, -holders-options, -position-options are group of options. If you invoke the just the option -help you will see the documentation about the input argument options, also running the test you will get an output file: 
> TestBatchCallerCommandLineParser.out with this output (englis/spanish, it depends of your local configuration).
> I have defined a DisplaceDateValidator, that extends DateValidator, it just convert a displace date operator (D-n) in the corresponding date (current day minus n-days). This validator works, the problem comes when I want to invoke the parser with more group of options. As you can see on the source code the algorithm for creating -holders-options, -movements-options, -positions-options, so having one or two or more group options has to be treated on the same way.
> Thanks, 
> David

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org