Skip to content

Commit 08cf0f5

Browse files
committed
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
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/cli/branches/cli-1.0.x@551813 13f79535-47bb-0310-9956-ffa450edef68
1 parent 7220ac2 commit 08cf0f5

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

src/java/org/apache/commons/cli/CommandLineParser.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,13 @@ CommandLine parse(Options options, String[] arguments)
5252
* @throws ParseException if there are any problems encountered
5353
* while parsing the command line tokens.
5454
*/
55+
/* To maintain binary compatibility, this is commented out.
56+
It is still in the abstract Parser class, so most users will
57+
still reap the benefit.
5558
CommandLine parse(Options options, String[] arguments,
5659
Properties properties)
5760
throws ParseException;
61+
*/
5862

5963
/**
6064
* Parse the arguments according to the specified options.
@@ -68,13 +72,9 @@ CommandLine parse(Options options, String[] arguments,
6872
* @throws ParseException if there are any problems encountered
6973
* while parsing the command line tokens.
7074
*/
71-
/* To maintain binary compatibility, this is commented out.
72-
It is still in the abstract Parser class, so most users will
73-
still reap the benefit.
7475
CommandLine parse(Options options, String[] arguments,
7576
boolean stopAtNonOption)
7677
throws ParseException;
77-
*/
7878

7979
/**
8080
* Parse the arguments according to the specified options and

src/test/org/apache/commons/cli/ValueTest.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public void setUp()
9191

9292
try
9393
{
94-
CommandLineParser parser = new PosixParser();
94+
Parser parser = new PosixParser();
9595
_cl = parser.parse(opts,args);
9696
}
9797
catch (ParseException e)
@@ -137,7 +137,7 @@ public void testShortOptionalArgNoValue()
137137
};
138138
try
139139
{
140-
CommandLineParser parser = new PosixParser();
140+
Parser parser = new PosixParser();
141141
CommandLine cmd = parser.parse(opts,args);
142142
assertTrue( cmd.hasOption("e") );
143143
assertNull( cmd.getOptionValue("e") );
@@ -154,7 +154,7 @@ public void testShortOptionalArgValue()
154154
};
155155
try
156156
{
157-
CommandLineParser parser = new PosixParser();
157+
Parser parser = new PosixParser();
158158
CommandLine cmd = parser.parse(opts,args);
159159
assertTrue( cmd.hasOption("e") );
160160
assertEquals( "everything", cmd.getOptionValue("e") );
@@ -171,7 +171,7 @@ public void testLongOptionalNoValue()
171171
};
172172
try
173173
{
174-
CommandLineParser parser = new PosixParser();
174+
Parser parser = new PosixParser();
175175
CommandLine cmd = parser.parse(opts,args);
176176
assertTrue( cmd.hasOption("fish") );
177177
assertNull( cmd.getOptionValue("fish") );
@@ -188,7 +188,7 @@ public void testLongOptionalArgValue()
188188
};
189189
try
190190
{
191-
CommandLineParser parser = new PosixParser();
191+
Parser parser = new PosixParser();
192192
CommandLine cmd = parser.parse(opts,args);
193193
assertTrue( cmd.hasOption("fish") );
194194
assertEquals( "face", cmd.getOptionValue("fish") );
@@ -205,7 +205,7 @@ public void testShortOptionalArgValues()
205205
};
206206
try
207207
{
208-
CommandLineParser parser = new PosixParser();
208+
Parser parser = new PosixParser();
209209
CommandLine cmd = parser.parse(opts,args);
210210
assertTrue( cmd.hasOption("j") );
211211
assertEquals( "ink", cmd.getOptionValue("j") );
@@ -225,7 +225,7 @@ public void testLongOptionalArgValues()
225225
};
226226
try
227227
{
228-
CommandLineParser parser = new PosixParser();
228+
Parser parser = new PosixParser();
229229
CommandLine cmd = parser.parse(opts,args);
230230
assertTrue( cmd.hasOption("gravy") );
231231
assertEquals( "gold", cmd.getOptionValue("gravy") );
@@ -245,7 +245,7 @@ public void testShortOptionalNArgValues()
245245
};
246246
try
247247
{
248-
CommandLineParser parser = new PosixParser();
248+
Parser parser = new PosixParser();
249249
CommandLine cmd = parser.parse(opts,args);
250250
assertTrue( cmd.hasOption("i") );
251251
assertEquals( "ink", cmd.getOptionValue("i") );
@@ -267,7 +267,7 @@ public void testLongOptionalNArgValues()
267267
"--hide", "house", "hair", "head"
268268
};
269269

270-
CommandLineParser parser = new PosixParser();
270+
Parser parser = new PosixParser();
271271

272272
try
273273
{
@@ -290,7 +290,7 @@ public void testPropertyOptionSingularValue()
290290
Properties properties = new Properties();
291291
properties.setProperty( "hide", "seek" );
292292

293-
CommandLineParser parser = new PosixParser();
293+
Parser parser = new PosixParser();
294294

295295
try
296296
{
@@ -312,7 +312,7 @@ public void testPropertyOptionFlags()
312312
properties.setProperty( "c", "yes" );
313313
properties.setProperty( "e", "1" );
314314

315-
CommandLineParser parser = new PosixParser();
315+
Parser parser = new PosixParser();
316316

317317
try
318318
{
@@ -380,7 +380,7 @@ public void testPropertyOptionMultipleValues()
380380
Properties properties = new Properties();
381381
properties.setProperty( "k", "one,two" );
382382

383-
CommandLineParser parser = new PosixParser();
383+
Parser parser = new PosixParser();
384384

385385
String[] values = new String[] {
386386
"one", "two"
@@ -410,7 +410,7 @@ public void testPropertyOverrideValues()
410410
properties.setProperty( "j", "seek" );
411411
try
412412
{
413-
CommandLineParser parser = new PosixParser();
413+
Parser parser = new PosixParser();
414414
CommandLine cmd = parser.parse(opts, args, properties);
415415
assertTrue( cmd.hasOption("j") );
416416
assertEquals( "found", cmd.getOptionValue("j") );

0 commit comments

Comments
 (0)