mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

boli
17.11.2010 1c73a49470fceb6c8b43cc7bb51f49e7e0ba7667
sdk/src/com/sun/opends/sdk/tools/ArgumentParser.java
@@ -1884,59 +1884,9 @@
    // indent the description five characters and try our best to wrap
    // at or
    // before column 79 so it will be friendly to 80-column displays.
    final LocalizableMessage description = a.getDescription();
    final int descMaxLength = MAX_LENGTH - indentLength - 1;
    if (description.length() <= descMaxLength)
    {
      buffer.append(INDENT);
      buffer.append(description);
      buffer.append(EOL);
    }
    else
    {
      String s = description.toString();
      while (s.length() > descMaxLength)
      {
        int spacePos = s.lastIndexOf(' ', descMaxLength);
        if (spacePos > 0)
        {
          buffer.append(INDENT);
          buffer.append(s.substring(0, spacePos).trim());
          s = s.substring(spacePos + 1).trim();
          buffer.append(EOL);
        }
        else
        {
          // There are no spaces in the first 74 columns. See if there
          // is one
          // after that point. If so, then break there. If not, then
          // don't
          // break at all.
          spacePos = s.indexOf(' ');
          if (spacePos > 0)
          {
            buffer.append(INDENT);
            buffer.append(s.substring(0, spacePos).trim());
            s = s.substring(spacePos + 1).trim();
            buffer.append(EOL);
          }
          else
          {
            buffer.append(INDENT);
            buffer.append(s);
            s = "";
            buffer.append(EOL);
          }
        }
      }
      if (s.length() > 0)
      {
        buffer.append(INDENT);
        buffer.append(s);
        buffer.append(EOL);
      }
    }
    buffer.append(
        Utils.wrapText(a.getDescription(), MAX_LENGTH, indentLength));
    buffer.append(EOL);
    if (a.needsValue() && (a.getDefaultValue() != null)
        && (a.getDefaultValue().length() > 0))