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 34228] New: - Not handling property=value followed by 'remaining' args
Date Tue, 29 Mar 2005 20:16:34 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34228>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34228

           Summary: Not handling property=value followed by 'remaining' args
           Product: Commons
           Version: unspecified
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: CLI
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: jskufca@ud.com


If you have a command line args similar to

domything -Dmyprop1=myval1 -Dmyprop2=myval2 myfile

I would expect to be able to set up the 'D' option so that 

 String[] opts = line.getOptionValues( "D" );
 assertEquals( "myprop1", opts[0] );
 assertEquals( "myval1", opts[1] );
 assertEquals( "myprop2", opts[2] );
 assertEquals( "myval2", opts[3] );

 String[] xtraArgs = line.getArgs();
 assertEquals( "myfile", xtraArgs[0]);

But, setting up similar to the ApplicationTest.java I get 'myfile' as opts
[4].  Since we have set up the 'D' option with hasArgs, it will only stop 
adding args to 'D' when it runs into another valid option, not an extra arg.  
If you set up the 'D' option with hasArg (singular) then it myprop1=myval1 
gets reported as an invalid option.

I've glanced at the source but didn't see an obvious fix that wouldn't 
jeopardize the combinations and permutations that Option.addValue() must deal 
with.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message