Commons CLI
  1. Commons CLI
  2. CLI-187

OptionBuilder working incorrectly at first Invocation of create(...)

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Duplicate
    • Affects Version/s: 1.1
    • Fix Version/s: 1.3
    • Component/s: Options definition
    • Labels:
      None

      Description

      OptionBuilder is working incorrectly when invoked for the first time. Since "argName" is null the arg-text will not be initialized for the first option created. argName is set on the call to reset() though.
      So after the first Option created OptionBuilder works fine.

      1. OptionBuilder.patch
        1 kB
        Kristoff Kiefer

        Issue Links

          Activity

          Kristoff Kiefer created issue -
          Kristoff Kiefer made changes -
          Field Original Value New Value
          Link This issue relates to CLI-186 [ CLI-186 ]
          Hide
          Kristoff Kiefer added a comment - - edited

          I think I already found it.

          I attached a patch

          Show
          Kristoff Kiefer added a comment - - edited I think I already found it. I attached a patch
          Kristoff Kiefer made changes -
          Attachment OptionBuilder.patch [ 12415226 ]
          Hide
          Emmanuel Bourg added a comment - - edited

          Thank you for pointing this, there is indeed an inconsistency. The default argument name is already defined in HelpFormatter and this is where it really belongs.

          Show
          Emmanuel Bourg added a comment - - edited Thank you for pointing this, there is indeed an inconsistency. The default argument name is already defined in HelpFormatter and this is where it really belongs.
          Emmanuel Bourg made changes -
          Fix Version/s 1.3 [ 12313321 ]
          Affects Version/s 1.1 [ 12311979 ]
          Affects Version/s 1.3 [ 12313321 ]
          Hide
          Emmanuel Bourg added a comment -

          Resolving as duplicate of CLI-186 since it's basically the reason that explains this bug.

          Show
          Emmanuel Bourg added a comment - Resolving as duplicate of CLI-186 since it's basically the reason that explains this bug.
          Emmanuel Bourg made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Duplicate [ 3 ]
          Mark Thomas made changes -
          Workflow jira [ 12472091 ] Default workflow, editable Closed status [ 12601489 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Kristoff Kiefer
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development