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 10:06:22 UTC

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

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


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


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

Posted by "David Leal (JIRA)" <ji...@apache.org>.
    [ 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


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

Posted by "David Leal (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/CLI-125?page=comments#action_12434301 ] 
            
David Leal commented on CLI-125:
--------------------------------

Andrew,

That is right, the validator is called twice without sense. After invokation of validate, the list is converted into Date each valid element, so there is no need to validate something that is already a Date type.

But this situation as you can see doesn't happen always, you can see other example on the testing class that expect a Date in a String format and it works without problem. It ocurres only on complex input argument example, where it has to parse two group of options that can contains an option that expect a Date in a String format.

I am trying to send you as soon as possible the -help output in order to see the syntax definition of my input arguments.

Thanks for your interest and help

> 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


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

Posted by "Andrew Shirley (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/CLI-125?page=comments#action_12434286 ] 
            
Andrew Shirley commented on CLI-125:
------------------------------------

I have looked at this tonight and not really got anywhere. The problem is essentially that the validator is being called twice, the first time it normalises, accepts it and DateValidator changes it to a Date object, the second time through it ClassCasts as it was expecting a String. Why it is run twice I cannot say, It appears to happen without your subclass of DateValidator and is definatly a bug in CLI, probably in how validate() is called somewhere. hopefully I can look further and find where this is happening, I will keep you informed and if you find out anything useful, please add a comment

> 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


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

Posted by "David Leal (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/CLI-125?page=all ]

David Leal updated CLI-125:
---------------------------

    Attachment: BatchCallerCommandLineParser_help_en.out

The output when invoking -help option in order to understand the input argument syntax definition.

> 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: BatchCallerCommandLineParser_help_en.out, 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


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

Posted by "David Leal (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/CLI-125?page=all ]

David Leal updated CLI-125:
---------------------------

    Attachment: TEST-com.schinvest.lra.business.batch.commandLine.batchCaller.TestBatchCallerCommandLineParser.txt

Output of the test.

> 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


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

Posted by "David Leal (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/CLI-125?page=comments#action_12436347 ] 
            
David Leal commented on CLI-125:
--------------------------------

I have found another test case that fails and is related with data input argument type:

public final void testPossibleBug2() throws Exception {
    String[] args = new String[] { "-r", "-t", "templateId", "-gCompId",
        "1", "-f", "csv", "-sDate", "01/01/2006", "-eDate",
         "01/02/2006", "-pNames", "name1", "-pValues", "val1" };
    parser.parse(args);
}

Produce the following error:

org.apache.commons.cli2.OptionException: Unexpected -f while processing -l|-t|-sDate|-eDate|-gCompId|-pNames|-pValues|-f
	at org.apache.commons.cli2.option.GroupImpl.validate(GroupImpl.java:270)
	at org.apache.commons.cli2.option.ParentImpl.validate(ParentImpl.java:127)
	at org.apache.commons.cli2.option.DefaultOption.validate(DefaultOption.java:175)
	at org.apache.commons.cli2.option.GroupImpl.validate(GroupImpl.java:264)
	at org.apache.commons.cli2.commandline.Parser.parse(Parser.java:105)
	at com.schinvest.lra.business.batch.commandLine.batchCaller.BatchCallerCommandLineParser.parse(BatchCallerCommandLineParser.java:226)
	at com.schinvest.lra.business.batch.commandLine.batchCaller.TestBatchCallerCommandLineParser.testPossibleBug2(TestBatchCallerCommandLineParser.java:268)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at junit.framework.TestCase.runTest(TestCase.java:164)
	at junit.framework.TestCase.runBare(TestCase.java:130)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:120)
	at junit.framework.TestSuite.runTest(TestSuite.java:230)
	at junit.framework.TestSuite.run(TestSuite.java:225)
	at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

but, if I supress the option -eDate it works.

Now if I eliminate the -pNames, -pValues and mantain -sDate, -eDate it works:

public final void testPossibleBug2() throws Exception {
  String[] args = new String[] { "-r", "-t", "templateId", "-gCompId",
      "1", "-f", "csv", "-sDate", "01/01/2006", "-eDate",
      "01/02/2006" };
  parser.parse(args);
}

It looks like a mistery, isn't it, :-)

> 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: BatchCallerCommandLineParser_help_en.out, 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


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

Posted by "David Leal (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/CLI-125?page=all ]

David Leal updated CLI-125:
---------------------------

    Attachment: TestBatchCallerCommandLineParser.java

The testing class, the test fails when testing the method: testRealExamples.

> 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, 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


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

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CLI-125?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell updated CLI-125:
------------------------------

    Fix Version/s: 2.1

> Invokes Date Validator for a Date type (fail on real example)
> -------------------------------------------------------------
>
>                 Key: CLI-125
>                 URL: https://issues.apache.org/jira/browse/CLI-125
>             Project: Commons CLI
>          Issue Type: Bug
>          Components: CLI-2.x
>    Affects Versions: Nightly Builds
>            Reporter: David Leal
>             Fix For: 2.1
>
>         Attachments: BatchCallerCommandLineParser_help_en.out, 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.
-
You can reply to this email to add a comment to the issue online.


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


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

Posted by "David Leal (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/CLI-125?page=all ]

David Leal updated CLI-125:
---------------------------

    Attachment: com.zip

All required source files. In order to compile you will need the Commons Lang Library (for enums), but this is required too for CLI.

> 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
>
>
> 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


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

Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CLI-125?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henri Yandell updated CLI-125:
------------------------------

    Component/s: CLI-2.x

> Invokes Date Validator for a Date type (fail on real example)
> -------------------------------------------------------------
>
>                 Key: CLI-125
>                 URL: https://issues.apache.org/jira/browse/CLI-125
>             Project: Commons CLI
>          Issue Type: Bug
>          Components: CLI-2.x
>    Affects Versions: Nightly Builds
>            Reporter: David Leal
>             Fix For: 2.1
>
>         Attachments: BatchCallerCommandLineParser_help_en.out, 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.
-
You can reply to this email to add a comment to the issue online.


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