commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Shirley (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CLI-117) Improve the group option desing (ids, more than one instance, etc)
Date Fri, 30 Jun 2006 11:20:32 GMT
    [ http://issues.apache.org/jira/browse/CLI-117?page=comments#action_12418624 ] 

Andrew Shirley commented on CLI-117:
------------------------------------

Issues 1 and 3 are related to a misunderstanding and the use-cases for Group needs to be clarified
as I get the impression that it wasn't intended for  repetition of a series of 'Option's but
for imposing mutual exclusivity type constraints, for example allowing either  "-url http://www.example.com"
or "-file /etc/foo" but not both. Or similarly forcing any 2 of 3 'Option's. There is certainly
a use-case whereby we say the following set of 'Option's should repeat between 4 and 7 times
and this should probably be a new Option implementation.

the real issue is that we should code a new Option implementation to adress 1 and 3 and devise
a new query mechanism to work better for deeper tree structures to address 2.

> Improve the group option desing (ids, more than one instance, etc)
> ------------------------------------------------------------------
>
>          Key: CLI-117
>          URL: http://issues.apache.org/jira/browse/CLI-117
>      Project: Commons CLI
>         Type: Improvement

>     Versions: Nightly Builds
>     Reporter: David Leal

>
> I am ussing the group option and on my humble opionion it should be improved, for example:

> 1) API doesn't support for the moment a group of options like this:
> - people
>   -id|size|age
> but for more than one instance of the group, for example:
> - people -id id1 -size 1 -age 10 -people -id id2 size 2 age 20
> so, the group option are the same for each people, but with id argument you can identify
each element of the group. 
> 2) There is no way to unique identify a option in a given group, for example: Now the
following syntax is not possible:
> -id <name> 
> - people
>   -id|size|age
> so, the general option name is id, and the group option is also id. When using the CommandLine.hasOption("-id"),
there is no way to distinguish if it is a group option or just a general option. On my opinion,
the group option should be checked if there are present using the root group option as prefix,
for example something like this: CommandLine.hasOption("-people|-id"), so we are clearly looking
for the group option -id from people and with: CommandLine.hasOption("-id") we look for general
-id option.
> 3) There is no clear the use of GroupBuilder.withMaximum() and GroupBulder.withMinimum(),
I expected to allow more than one group option on the command line, like I have commented
on 1), but it doesn't work and the API doesn't allow to distinguish each group instances.
> Thanks in advance,
> David

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message