From 184ed890c828220c114f60ee165ce2230ada3d7c Mon Sep 17 00:00:00 2001
From: lutoff <lutoff@localhost>
Date: Tue, 15 May 2007 08:10:13 +0000
Subject: [PATCH] issue 1430 fix (all utilities should provide as standard option -V/--version) to specify the LDAP protocol version number, we should use now      -V/--ldapVersion  to get the 'product' version    --version

---
 opends/src/statuspanel/org/opends/statuspanel/StatusPanelLauncher.java |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/opends/src/statuspanel/org/opends/statuspanel/StatusPanelLauncher.java b/opends/src/statuspanel/org/opends/statuspanel/StatusPanelLauncher.java
index 3c19010..d502668 100644
--- a/opends/src/statuspanel/org/opends/statuspanel/StatusPanelLauncher.java
+++ b/opends/src/statuspanel/org/opends/statuspanel/StatusPanelLauncher.java
@@ -28,13 +28,16 @@
 
 import java.io.ByteArrayOutputStream;
 import java.io.File;
+import java.io.IOException;
 import java.io.PrintStream;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import org.opends.quicksetup.util.Utils;
 import org.opends.quicksetup.Installation;
+import org.opends.server.core.DirectoryServer;
 import org.opends.statuspanel.i18n.ResourceProvider;
+import static org.opends.server.tools.ToolConstants.*;
 
 /**
  * This class is called by the control panel command lines to launch the
@@ -66,6 +69,7 @@
       t.printStackTrace();
     }
     boolean printUsage = false;
+    boolean printVersion = false;
     if ((args != null) && (args.length > 4))
     {
       printUsage = true;
@@ -78,7 +82,27 @@
       {
         printUsage = true;
       }
+      else
+      if (args[i].equalsIgnoreCase("-" + OPTION_SHORT_PRODUCT_VERSION) ||
+          args[i].equalsIgnoreCase("--" + OPTION_LONG_PRODUCT_VERSION))
+      {
+        printVersion = true;
+      }
     }
+    // We first check if we have to pribt the version
+    if(printVersion)
+    {
+      try
+      {
+        DirectoryServer.printVersion(System.out);
+      }
+      catch (IOException e)
+      {
+        // TODO Auto-generated catch block
+      }
+      System.exit(1);
+    }
+    else
     if (printUsage)
     {
       printUsage(System.out);

--
Gitblit v1.10.0