You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2002/10/31 23:42:32 UTC

DO NOT REPLY [Bug 13937] - Request that Options support hierarical options

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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>