From ee021bead4d9a72f6f2e6b52222ff4013cbc8b71 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Tue, 20 Jan 2015 09:26:46 +0000
Subject: [PATCH] OPENDJ-1734 (CR-5811) V/-version option does not work for some tools

---
 opendj3-server-dev/src/server/org/opends/server/tools/LDIFSearch.java |   37 ++++++++-----------------------------
 1 files changed, 8 insertions(+), 29 deletions(-)

diff --git a/opendj3-server-dev/src/server/org/opends/server/tools/LDIFSearch.java b/opendj3-server-dev/src/server/org/opends/server/tools/LDIFSearch.java
index 4d6b67d..1284277 100644
--- a/opendj3-server-dev/src/server/org/opends/server/tools/LDIFSearch.java
+++ b/opendj3-server-dev/src/server/org/opends/server/tools/LDIFSearch.java
@@ -22,7 +22,7 @@
  *
  *
  *      Copyright 2006-2008 Sun Microsystems, Inc.
- *      Portions Copyright 2013-2014 ForgeRock AS
+ *      Portions Copyright 2013-2015 ForgeRock AS
  */
 package org.opends.server.tools;
 
@@ -38,6 +38,7 @@
 import org.forgerock.i18n.LocalizableMessage;
 import org.forgerock.opendj.ldap.SearchScope;
 import org.opends.server.core.DirectoryServer;
+import org.opends.server.core.DirectoryServer.DirectoryServerVersionHandler;
 import org.opends.server.extensions.ConfigFileHandler;
 import org.opends.server.loggers.JDKLogging;
 import org.opends.server.protocols.ldap.LDAPResultCode;
@@ -66,41 +67,18 @@
  */
 public class LDIFSearch
 {
-  /**
-   * The fully-qualified name of this class.
-   */
+  /** The fully-qualified name of this class. */
   private static final String CLASS_NAME = "org.opends.server.tools.LDIFSearch";
 
-
-
-  /**
-   * The search scope string that will be used for baseObject searches.
-   */
+  /** The search scope string that will be used for baseObject searches. */
   private static final String SCOPE_STRING_BASE = "base";
-
-
-
-  /**
-   * The search scope string that will be used for singleLevel searches.
-   */
+  /** The search scope string that will be used for singleLevel searches. */
   private static final String SCOPE_STRING_ONE = "one";
-
-
-
-  /**
-   * The search scope string that will be used for wholeSubtree searches.
-   */
+  /** The search scope string that will be used for wholeSubtree searches. */
   private static final String SCOPE_STRING_SUB = "sub";
-
-
-
-  /**
-   * The search scope string that will be used for subordinateSubtree searches.
-   */
+  /** The search scope string that will be used for subordinateSubtree searches. */
   private static final String SCOPE_STRING_SUBORDINATE = "subordinate";
 
-
-
   /**
    * Provides the command line arguments to the <CODE>mainSearch</CODE> method
    * so that they can be processed.
@@ -166,6 +144,7 @@
     ArgumentParser argParser = new ArgumentParser(CLASS_NAME, toolDescription,
                                                   false, true, 0, 0,
                                                   "[filter] [attributes ...]");
+    argParser.setVersionHandler(new DirectoryServerVersionHandler());
 
     try
     {

--
Gitblit v1.10.0