commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David <achepat...@yahoo.es>
Subject Re: [CLI]: Can have two group options with an option with the same shortname?
Date Tue, 06 Jun 2006 10:06:35 GMT
Dera Andrew,
   
  Thanks for your respons, I have thought about that, just that I don't like it because I
have to propagate the dependence on CLI classes on the class that analyze the input arguments.
   
  A good solution would be to use the following sintax on hasOption():
  groupOptionName|optionName, so in my case would be:
  hasOption(report|date)
   
  Becuase I have not response until yours I have added a new features request on CLI JIRA:
   
  http://issues.apache.org/jira/browse/CLI-117
   
  Thanks,
   
  David

Andrew Shirley <aks@decisionsoft.co.uk> wrote:
  On Fri, Jun 02, 2006 at 06:34:03AM -0700, David wrote:
> Dear members,
> 
> I have two group options appended to my main group option of my
> parser. Let's say -report group option and -process group option. On
> both I would like to define the option -date, but I don't know how
> to distinguish each case when invoking:
> 
> line.hasOption("-date");
> 
> is there any way to specifically say, I just want to know if has
> option -date from group option -report?
> 

when you are creating the Option objects (for the date option), you
could store them away somewhere and then do the lookup using
CommandLine#hasOption(Option) and similarly CommandLine#getValue(Option)

hope this helps
Andrew

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



		
---------------------------------
Do you Yahoo!?
 Get on board. You're invited to try the new Yahoo! Mail Beta.
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message