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

neil_a_wilson
15.50.2006 3beceb095561bff52b4fb6bf3bb7bb7a2d9e079f
opendj-sdk/opends/src/server/org/opends/server/tools/LDAPDelete.java
@@ -440,7 +440,7 @@
      argParser.addArgument(deleteSubtree);
      controlStr =
           new StringArgument("controls", 'J', "controls", false, false, true,
           new StringArgument("control", 'J', "control", false, true, true,
                    "{controloid[:criticality[:value|::b64value|:<fileurl]]}",
                    null, null, MSGID_DESCRIPTION_CONTROLS);
      argParser.addArgument(controlStr);
@@ -591,20 +591,24 @@
    deleteOptions.setContinueOnError(continueOnError.isPresent());
    deleteOptions.setEncoding(encodingStr.getValue());
    deleteOptions.setDeleteSubtree(deleteSubtree.isPresent());
    if(controlStr.hasValue())
    if(controlStr.isPresent())
    {
      String ctrlString = controlStr.getValue();
      LDAPControl ctrl = LDAPToolUtils.getControl(ctrlString, err);
      if(ctrl == null)
      for (String ctrlString : controlStr.getValues())
      {
        int    msgID   = MSGID_TOOL_INVALID_CONTROL_STRING;
        String message = getMessage(msgID, ctrlString);
        err.println(wrapText(message, MAX_LINE_WIDTH));
        err.println(argParser.getUsage());
        return 1;
        LDAPControl ctrl = LDAPToolUtils.getControl(ctrlString, err);
        if(ctrl == null)
        {
          int    msgID   = MSGID_TOOL_INVALID_CONTROL_STRING;
          String message = getMessage(msgID, ctrlString);
          err.println(wrapText(message, MAX_LINE_WIDTH));
          err.println(argParser.getUsage());
          return 1;
        }
        deleteOptions.getControls().add(ctrl);
      }
      deleteOptions.getControls().add(ctrl);
    }
    if(deleteOptions.getDeleteSubtree())
    {
      LDAPControl control = new LDAPControl(OID_SUBTREE_DELETE_CONTROL);