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 13937] - Request that Options support hierarical options
Date Thu, 31 Oct 2002 22:42:32 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=13937>.
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=13937

Request that Options support hierarical options

jbjk@mac.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|commons-                    |jbjk@mac.com
                   |dev@jakarta.apache.org      |



------- Additional Comments From jbjk@mac.com  2002-10-31 22:42 -------
Joe,

This is achieved through using the 'getArgs' and 'getArgsList' methods defined
on CommandLine and also by creating an Options object for each part.  So for the
example you specify you need three Options e.g.

Options1 = -t and -u
Options2 = -x and -y
Options3 = -a, -b and -c

String[] args = new String[] { "-t", "-x", "-y", "value" };

CommandLine cmd = parser.parse( args, Options1 );

CommandLine cmd2 = null;
if( cmd.hasOption( "t" ) ) {
    cmd2 = parser.parse( cmd.getArgs(), Options2 );
}
else if( cmd.hasOption( "-u" ) ) {
    cmd2 = parser.parse( cmd.getArgs(), Options3 );
}

So I am marking this as not being a bug.  If you have any other comments on this
then please add them to this bug.

Cheers,
-John K

--
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