commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henryk Konsek <>
Subject [CLI] Option.setArgs and Option.setArgName issues
Date Sat, 30 Dec 2006 21:41:49 GMT
    I was wondering about two scenarios. The first one:

 option.setArgName( "argName" );

Which results in something like this when printing help:

 -myoption <argName>

I can't code something like:

 option.setArgName( 1, "argName1" );
 option.setArgName( 2, "argName2" ); I was wondering whether is there any way to achieve something like:

 -myoption <argName1> <argName2>

The second issue I can't figure out is how to enforce checking of amount 
of arguments for option. That is how to prevent situations in which user 
passes too much arguments for option (for instance for option with two 

java -jar command.jar -myoption one two three

At this moment I can't even check it in the code after getOptionValues() 
due to the fact that additional arguments are simply ignored.

I would be grateful for any suggestions.


Henryk Konsek

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message