commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 16484] New: - Error parsing options a-la Java property option
Date Tue, 28 Jan 2003 09:32:17 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16484>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16484

Error parsing options a-la Java property option

           Summary: Error parsing options a-la Java property option
           Product: Commons
           Version: 1.0 Final
          Platform: PC
        OS/Version: Other
            Status: NEW
          Severity: Major
          Priority: Other
         Component: CLI
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: barancev@kazbek.ispras.ru


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.

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


Mime
View raw message