From cf102e91e13c1134657843c065fb29d50edaa7dc Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Mon, 26 Jan 2009 16:02:21 +0000
Subject: [PATCH] Extend DirectoryServer so that other tools launching it can impose their own usage message.

---
 opends/src/server/org/opends/server/core/DirectoryServer.java |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/opends/src/server/org/opends/server/core/DirectoryServer.java b/opends/src/server/org/opends/server/core/DirectoryServer.java
index ae8d9b1..bd3e97a 100644
--- a/opends/src/server/org/opends/server/core/DirectoryServer.java
+++ b/opends/src/server/org/opends/server/core/DirectoryServer.java
@@ -245,6 +245,11 @@
    */
   private static boolean serverLocked = false;
 
+  /**
+   * The message to be displayed on the command-line when the user asks for the
+   * usage.
+   */
+  private static Message toolDescription = INFO_DSCORE_TOOL_DESCRIPTION.get();
 
   /**
    * Return codes used when the hidden option --checkStartability is used.
@@ -8920,6 +8925,16 @@
   }
 
 
+  /**
+   * Sets the message to be displayed on the command-line when the user asks for
+   * the usage.
+   * @param msg the message to be displayed on the command-line when the user
+   * asks for the usage.
+   */
+  public static void setToolDescription (Message msg)
+  {
+    toolDescription = msg;
+  }
 
   /**
    * Retrieves the DN of the configuration entry with which this alert generator
@@ -9056,7 +9071,7 @@
 
 
     // Create the command-line argument parser for use with this program.
-    Message toolDescription = INFO_DSCORE_TOOL_DESCRIPTION.get();
+    Message toolDescription = DirectoryServer.toolDescription;
     ArgumentParser argParser =
          new ArgumentParser("org.opends.server.core.DirectoryServer",
                             toolDescription, false);

--
Gitblit v1.10.0