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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: 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

          Hide
          deexem Kristoff Kiefer added a comment - - edited

          I think I already found it.

          I attached a patch

          Show
          deexem Kristoff Kiefer added a comment - - edited I think I already found it. I attached a patch
          Hide
          ebourg 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
          ebourg 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.
          Hide
          ebourg Emmanuel Bourg added a comment -

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

          Show
          ebourg Emmanuel Bourg added a comment - Resolving as duplicate of CLI-186 since it's basically the reason that explains this bug.

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development