You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by David <ac...@yahoo.es> on 2006/06/02 15:34:03 UTC
[CLI]: Can have two group options with an option with the same shortname?
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?
Thansk in advance,
David
Note: I am using CLI2
---------------------------------
Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously low rates.
Re: [CLI]: Can have two group options with an option with the same shortname?
Posted by David <ac...@yahoo.es>.
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 <ak...@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.
Re: [CLI]: Can have two group options with an option with the same shortname?
Posted by Andrew Shirley <ak...@decisionsoft.co.uk>.
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