Thanks for the quick reply!
I wasn't aware that description was a unique key for distinguishing
attributes. Its fine for me as a quick fix but I agree with your long
term assessment that the semantics should be reevaluated.
Thanks,
Eric
On 6/30/06, Andrew Shirley <[EMAIL PROTECTED]> wrote:
On Thu, Jun 29, 2006 at 01:41:20PM -0400, Eric Sirianni wrote:
> This doesn't seem to work. Consider the following example:
>
> Is there a way to express my desired syntax using common-cli? Namely,
> I want to be able to have two groups with the same shortnamed option.
> The groups may or may not be mutually exclusive.
This doesn't work because nameOption.equals(dbNameOption) == true and so
foo is registered as a value with that option, it has a maximum of 1
(default) and so when another comes along (bar) it isn't processed.
If you make the two different (by giving them a different description,
say) then the code you gave will work.
DefaultOption nameOption =
defaultOptionBuilder.withDescription("desc").withShortName("name").withArgument(nameArgument).withRequired(true).create();
DefaultOption dbNameOption =
defaultOptionBuilder.withDescription("different").withShortName("name").withArgument(dbNameArgument).withRequired(true).create();
This is obviously not a state we should be in and so i suggest we look
at all of the equals and hashcode methods to make sure they are correct.
Andrew Shirley
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]