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

[cli] Parser breaks up command line parms into single characters

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.1
    • CLI-1.x
    • None
    • Operating System: All
      Platform: All

    • 32525

    Description

      The base Parser class used to pull tokens from a command line breaks up
      command line options longer than 1 character. For example, -file becomes -f -
      i -l -e. This can be duplicated with the Ant example shown in the user guide.
      This is probably the cause for bug
      http://issues.apache.org/bugzilla/show_bug.cgi?id=31464 section 1 and 2.

      I have worked up a patch that fixes this problem and all of the JUnit tests
      run correctly after this patch is applied.

      There appear to be some shortcomings in the way the Parser class processes
      options. The main problem is that it doesn't maintain a state value indicating
      what is being processed so option parameters can be interpreted as options. To
      fix this the code needs to be reorganized. Because of this, I can't say this
      patch will work in every case but it is an improvement.

      Attachments

        Activity

          People

            Unassigned Unassigned
            dmorris@plumcreek.com David Morris
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: