Closed alegomes closed 2 months ago
No, I'm not sure how that would work. Options aren't ordered, so if you called the group option more than once, how would we know which instance of the group each option on the command line belongs to?
It sounds like subcommands would work better than groups here; you can repeat subccommands.
This is what I tought:
myCmd --groupedOpt=valueA --valueAargs1=x --valueAargs2=y --groupedOpt=valueB --valueBargs1=z
Which is the same groupChoice multiple times but with different values.
Does it make sense?
The problem is that options aren't ordered, so trying to parse repeated groups would be ambiguous:
myCmd --valueAargs1=x --valueAargs2=y --groupedOpt=valueA --valueAargs2=z --groupedOpt=valueA --valueAargs2=a
The problem is that options aren't ordered, so trying to parse repeated groups would be ambiguous:
myCmd --valueAargs1=x --valueAargs2=y --groupedOpt=valueA --valueAargs2=z --groupedOpt=valueA --valueAargs2=a
Even if you define all sub-options values as unique? i.e. valueAargs1 ≠ valueAargs2 ≠ valueBargs1 (…) ?
Yes. multiple
would mean that a group can be specified more than once, so there's no way to know which instance of a given group any invocation of one of its options should belong to.
But if you have two groups and want them both used at once, why bother with groupChoice
? You can just make them separate top level groups.
Can I use multiple() and choiceGroup() in the same option?
If not, what's the best alternative?
thanks