Author: bayard
Date: Thu Jun 28 23:54:58 2007
New Revision: 551813
URL: http://svn.apache.org/viewvc?view=rev&rev=551813
Log:
The previous commit removed an incorrect method. This puts it back and removes
the right one, along with a fix for a unit test that fails to compile as a
result. See CLI-134
Modified:
jakarta/commons/proper/cli/branches/cli-1.0.x/src/java/org/apache/commons/cli/CommandLineParser.java
jakarta/commons/proper/cli/branches/cli-1.0.x/src/test/org/apache/commons/cli/ValueTest.java
Modified:
jakarta/commons/proper/cli/branches/cli-1.0.x/src/java/org/apache/commons/cli/CommandLineParser.java
URL:
http://svn.apache.org/viewvc/jakarta/commons/proper/cli/branches/cli-1.0.x/src/java/org/apache/commons/cli/CommandLineParser.java?view=diff&rev=551813&r1=551812&r2=551813
==============================================================================
---
jakarta/commons/proper/cli/branches/cli-1.0.x/src/java/org/apache/commons/cli/CommandLineParser.java
(original)
+++
jakarta/commons/proper/cli/branches/cli-1.0.x/src/java/org/apache/commons/cli/CommandLineParser.java
Thu Jun 28 23:54:58 2007
@@ -52,9 +52,13 @@
* @throws ParseException if there are any problems encountered
* while parsing the command line tokens.
*/
+ /* To maintain binary compatibility, this is commented out.
+ It is still in the abstract Parser class, so most users will
+ still reap the benefit.
CommandLine parse(Options options, String[] arguments,
Properties properties)
throws ParseException;
+ */
/**
* Parse the arguments according to the specified options.
@@ -68,13 +72,9 @@
* @throws ParseException if there are any problems encountered
* while parsing the command line tokens.
*/
- /* To maintain binary compatibility, this is commented out.
- It is still in the abstract Parser class, so most users will
- still reap the benefit.
CommandLine parse(Options options, String[] arguments,
boolean stopAtNonOption)
throws ParseException;
- */
/**
* Parse the arguments according to the specified options and
Modified:
jakarta/commons/proper/cli/branches/cli-1.0.x/src/test/org/apache/commons/cli/ValueTest.java
URL:
http://svn.apache.org/viewvc/jakarta/commons/proper/cli/branches/cli-1.0.x/src/test/org/apache/commons/cli/ValueTest.java?view=diff&rev=551813&r1=551812&r2=551813
==============================================================================
---
jakarta/commons/proper/cli/branches/cli-1.0.x/src/test/org/apache/commons/cli/ValueTest.java
(original)
+++
jakarta/commons/proper/cli/branches/cli-1.0.x/src/test/org/apache/commons/cli/ValueTest.java
Thu Jun 28 23:54:58 2007
@@ -91,7 +91,7 @@
try
{
- CommandLineParser parser = new PosixParser();
+ Parser parser = new PosixParser();
_cl = parser.parse(opts,args);
}
catch (ParseException e)
@@ -137,7 +137,7 @@
};
try
{
- CommandLineParser parser = new PosixParser();
+ Parser parser = new PosixParser();
CommandLine cmd = parser.parse(opts,args);
assertTrue( cmd.hasOption("e") );
assertNull( cmd.getOptionValue("e") );
@@ -154,7 +154,7 @@
};
try
{
- CommandLineParser parser = new PosixParser();
+ Parser parser = new PosixParser();
CommandLine cmd = parser.parse(opts,args);
assertTrue( cmd.hasOption("e") );
assertEquals( "everything", cmd.getOptionValue("e") );
@@ -171,7 +171,7 @@
};
try
{
- CommandLineParser parser = new PosixParser();
+ Parser parser = new PosixParser();
CommandLine cmd = parser.parse(opts,args);
assertTrue( cmd.hasOption("fish") );
assertNull( cmd.getOptionValue("fish") );
@@ -188,7 +188,7 @@
};
try
{
- CommandLineParser parser = new PosixParser();
+ Parser parser = new PosixParser();
CommandLine cmd = parser.parse(opts,args);
assertTrue( cmd.hasOption("fish") );
assertEquals( "face", cmd.getOptionValue("fish") );
@@ -205,7 +205,7 @@
};
try
{
- CommandLineParser parser = new PosixParser();
+ Parser parser = new PosixParser();
CommandLine cmd = parser.parse(opts,args);
assertTrue( cmd.hasOption("j") );
assertEquals( "ink", cmd.getOptionValue("j") );
@@ -225,7 +225,7 @@
};
try
{
- CommandLineParser parser = new PosixParser();
+ Parser parser = new PosixParser();
CommandLine cmd = parser.parse(opts,args);
assertTrue( cmd.hasOption("gravy") );
assertEquals( "gold", cmd.getOptionValue("gravy") );
@@ -245,7 +245,7 @@
};
try
{
- CommandLineParser parser = new PosixParser();
+ Parser parser = new PosixParser();
CommandLine cmd = parser.parse(opts,args);
assertTrue( cmd.hasOption("i") );
assertEquals( "ink", cmd.getOptionValue("i") );
@@ -267,7 +267,7 @@
"--hide", "house", "hair", "head"
};
- CommandLineParser parser = new PosixParser();
+ Parser parser = new PosixParser();
try
{
@@ -290,7 +290,7 @@
Properties properties = new Properties();
properties.setProperty( "hide", "seek" );
- CommandLineParser parser = new PosixParser();
+ Parser parser = new PosixParser();
try
{
@@ -312,7 +312,7 @@
properties.setProperty( "c", "yes" );
properties.setProperty( "e", "1" );
- CommandLineParser parser = new PosixParser();
+ Parser parser = new PosixParser();
try
{
@@ -380,7 +380,7 @@
Properties properties = new Properties();
properties.setProperty( "k", "one,two" );
- CommandLineParser parser = new PosixParser();
+ Parser parser = new PosixParser();
String[] values = new String[] {
"one", "two"
@@ -410,7 +410,7 @@
properties.setProperty( "j", "seek" );
try
{
- CommandLineParser parser = new PosixParser();
+ Parser parser = new PosixParser();
CommandLine cmd = parser.parse(opts, args, properties);
assertTrue( cmd.hasOption("j") );
assertEquals( "found", cmd.getOptionValue("j") );
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]