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

[cli] separate definition and values

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: 2.0
    • Component/s: CLI-2.x
    • Labels:
      None
    • Environment:

      Operating System: other
      Platform: Other

    • Bugzilla Id:
      36189

      Description

      right now Option holds both configuration parameters - that say how to parese,
      and values - the result of parsing.

      this isn't very robust if options are used at places other than main(). for
      example, if some server application wants a cli interface (e.g., through a tcp
      connection), then the best approach for it would be to have a static variable
      with the options configuration and give it to the parser each time. with the
      current code, the Options object needs to be recreated every time.

      also, iterating over Options.getOptions() is cumbersome because some options may
      actually belong to an option group. it would be helpfull if Options.getOption
      would return a collection containing Option and OptionGroup, then the user can
      iterate over it, and with a simple 'instanceof' know what type it is, and then
      handle it.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                ittayd@qlusters.com Ittay Dror
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: