From c933bedb75818290b5a49ca178fcfc5340dbb3c3 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Wed, 15 Nov 2006 19:50:12 +0000
Subject: [PATCH] Update the LDAPSearch, LDAPModify, LDAPCompare, and LDAPDelete tools to rename the "--controls" argument to "--control", since each instance only allows the user to specify information about a single control. Issue #1009.
---
opends/src/server/org/opends/server/tools/LDAPCompare.java | 25 ++++++++++++++-----------
1 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/opends/src/server/org/opends/server/tools/LDAPCompare.java b/opends/src/server/org/opends/server/tools/LDAPCompare.java
index 8558177..6a099c6 100644
--- a/opends/src/server/org/opends/server/tools/LDAPCompare.java
+++ b/opends/src/server/org/opends/server/tools/LDAPCompare.java
@@ -464,7 +464,7 @@
argParser.addArgument(assertionFilter);
controlStr =
- new StringArgument("controls", 'J', "controls", false, false, true,
+ new StringArgument("control", 'J', "control", false, true, true,
"{controloid[:criticality[:value|::b64value|:<filePath]]}",
null, null, MSGID_DESCRIPTION_CONTROLS);
argParser.addArgument(controlStr);
@@ -698,19 +698,22 @@
compareOptions.setVerbose(verbose.isPresent());
compareOptions.setContinueOnError(continueOnError.isPresent());
compareOptions.setEncoding(encodingStr.getValue());
- 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;
+ }
+ compareOptions.getControls().add(ctrl);
}
- compareOptions.getControls().add(ctrl);
}
if (assertionFilter.isPresent())
--
Gitblit v1.10.0