Uploaded image for project: 'Thorntail'
  1. Thorntail
  2. THORN-1020

org.wildfly.swarm.cli.Option#parse checks the wrong position of equal when a long arg name with equal

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2017.1.1
    • Fix Version/s: 2017.3.2
    • Component/s: core
    • Labels:
      None

      Description

      org.wildfly.swarm.cli.Option#parse checks '=' position like below:

      if (cur.charAt(this.longArg.length() + 3) == '=') {
          [...]
      }
      

      https://github.com/wildfly-swarm/wildfly-swarm/blob/2017.1.1/core/container/src/main/java/org/wildfly/swarm/cli/Option.java#L308.

      But the charAt returns '=' + 1 position and the if statement will not be passed.

      e.g.

      cur: --foo=bar
      longArg: foo

      cur.charAt(this.longArg.length() + 3) returns 'b' .

      It should be pointed '2' instead of '3'.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                emag Yoshimasa Tanabe
                Reporter:
                emag Yoshimasa Tanabe
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: