commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Shirley <...@decisionsoft.co.uk>
Subject Re: [CLI]: Can have two group options with an option with the same shortname?
Date Tue, 06 Jun 2006 09:46:59 GMT
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


Mime
View raw message