Uploaded image for project: 'Commons CLI'
  1. Commons CLI
  2. CLI-117

Improve the group option desing (ids, more than one instance, etc)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Nightly Builds
    • 2.1
    • CLI-2.x
    • None

    Description

      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

      Attachments

        Activity

          People

            Unassigned Unassigned
            dleal David Leal
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: