Details
Description
import org.apache.commons.cli.*;
public class Test {
public static void main( String[] args ) {
try {
Options options = new Options();
options.addOption( OptionBuilder
.hasArg()
.withDescription( "Define a system property" )
.create( 'D' ) );
CommandLineParser parser = new PosixParser();
CommandLine cl = parser.parse( options, args );
for (java.util.Iterator i = cl.iterator(); i.hasNext(); )
{ System.err.println(i.next()); }System.err.println(cl.getArgList());
} catch (Throwable e)
{ e.printStackTrace(); }}
}
HOW TO REPRODUCE:
Compile this example and run for example
java -cp commons-cli-1.0-beta-2.jar:. Test -Da=b -Dc=d xxx
OBSERVED RESULT:
[ option: D :: Define a system property ]
[c=d, xxx]
EXPECTED RESULT:
[ option: D :: Define a system property ]
[ option: D :: Define a system property ]
[xxx]
ADDITIONAL INFO:
The error occured only in 1.0 version, versions 1.0-beta-2 and 1.0-beta-2-dev
have no such problem.