commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Shirley <>
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

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

View raw message