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

Make Option a generic class

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.4
    • Fix Version/s: None
    • Component/s: CLI-1.x, Options definition
    • Labels:
      None

      Description

      An Option can have a type (e.g. String, Number, ...) but this type can not automatically be inferred later since Option is not generic.

      It would be usefull to add a generic to the Option so the type can be inferred like Option<String>, Option<Number> and so on.
      The CommandLine can then have an

      <T> getParsedOptionValue(Option<T> opt)

      method so type-safe fetching of Option values is possible without any (optimistic) casting or typechecking is involved.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                laeubi Christoph Läubrich
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: