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

Make Option a generic class

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.4
    • None
    • CLI-1.x, Options definition
    • 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

              Unassigned Unassigned
              laeubi Christoph Läubrich
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: