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

CommandLine.getXXX and CommandLine.hasXXX should accept an Option as a parameter

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.4
    • Fix Version/s: 1.5
    • Component/s: CLI-1.x
    • Labels:
      None

      Description

      Currently there is some searching and String matching to find a matching option for the hasXXX and getXXX it would be nice to pass in an Option instance directly, this would also allow further improvements (e.g. infer the type of an option), prevents exhaustive search for matching option as well as type-safety.

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user laeubi opened a pull request:

          https://github.com/apache/commons-cli/pull/9

          Fix for CLI-271

          Add the posibility to use Options as a parameter for fetching values from the CommandLine.

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/laeubi/commons-cli CLI-271

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/commons-cli/pull/9.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #9


          commit e1f3164cba66b9ec83dfca320ea549d0f666fae5
          Author: laeubi <laeubi@laeubi-soft.de>
          Date: 2017-03-15T14:44:35Z

          Fix for CLI-271
          Add some Tests for coverage


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user laeubi opened a pull request: https://github.com/apache/commons-cli/pull/9 Fix for CLI-271 Add the posibility to use Options as a parameter for fetching values from the CommandLine. You can merge this pull request into a Git repository by running: $ git pull https://github.com/laeubi/commons-cli CLI-271 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/commons-cli/pull/9.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #9 commit e1f3164cba66b9ec83dfca320ea549d0f666fae5 Author: laeubi <laeubi@laeubi-soft.de> Date: 2017-03-15T14:44:35Z Fix for CLI-271 Add some Tests for coverage
          Show
          laeubi Christoph Läubrich added a comment - Opened https://github.com/apache/commons-cli/pull/9
          Hide
          britter Benedikt Ritter added a comment -
          ~/w/a/c/commons-cli > svn ci
          Sending        src/changes/changes.xml
          Sending        src/main/java/org/apache/commons/cli/CommandLine.java
          Sending        src/test/java/org/apache/commons/cli/CommandLineTest.java
          Sending        src/test/java/org/apache/commons/cli/OptionTest.java
          Sending        src/test/java/org/apache/commons/cli/ValueTest.java
          Sending        src/test/java/org/apache/commons/cli/bug/BugCLI133Test.java
          Transmitting file data ......done
          Committing transaction...
          Committed revision 1788678.
          

          Thank you for contributing!

          Show
          britter Benedikt Ritter added a comment - ~/w/a/c/commons-cli > svn ci Sending src/changes/changes.xml Sending src/main/java/org/apache/commons/cli/CommandLine.java Sending src/test/java/org/apache/commons/cli/CommandLineTest.java Sending src/test/java/org/apache/commons/cli/OptionTest.java Sending src/test/java/org/apache/commons/cli/ValueTest.java Sending src/test/java/org/apache/commons/cli/bug/BugCLI133Test.java Transmitting file data ......done Committing transaction... Committed revision 1788678. Thank you for contributing!
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/commons-cli/pull/9

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/commons-cli/pull/9

            People

            • Assignee:
              britter Benedikt Ritter
              Reporter:
              laeubi Christoph Läubrich
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development