From 607db4ead9220ca87d996bec891536368c39f941 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Thu, 05 Jul 2007 12:11:15 +0000
Subject: [PATCH] According to the usage of the graphical install and uninstall commands, the additional options are ignored if we do not specify the --cli option.  However currently if the user does not specify --cli and adds one of the other options, the usage is displayed.  With these modifications, usage is only displayed when user asks for it or when the user provides invalid options in CLI mode (which is more consistent with what is specified in the usage).

---
 opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Launcher.java                  |   14 +++++---------
 opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/installer/InstallLauncher.java |   25 -------------------------
 2 files changed, 5 insertions(+), 34 deletions(-)

diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Launcher.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Launcher.java
index 6727a5a..589ac57 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Launcher.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Launcher.java
@@ -68,15 +68,11 @@
    */
   protected boolean shouldPrintUsage() {
     boolean printUsage = false;
-    if (!isCli() && args.length > 0) {
-      printUsage = true;
-    } else {
-      if ((args != null) && (args.length > 0)) {
-        for (String arg : args) {
-          if (arg.equalsIgnoreCase("-H") ||
-                  arg.equalsIgnoreCase("--help")) {
-            printUsage = true;
-          }
+    if ((args != null) && (args.length > 0)) {
+      for (String arg : args) {
+        if (arg.equalsIgnoreCase("-H") ||
+          arg.equalsIgnoreCase("--help")) {
+          printUsage = true;
         }
       }
     }
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/installer/InstallLauncher.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/installer/InstallLauncher.java
index 822520a..dbed47c 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/installer/InstallLauncher.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/installer/InstallLauncher.java
@@ -94,31 +94,6 @@
   /**
    * {@inheritDoc}
    */
-  protected boolean shouldPrintUsage() {
-    boolean displayUsage = false;
-    if ((args != null) && (args.length > 0)) {
-      if (!isCli()) {
-        if (args.length > 0) {
-          if (args.length == 2) {
-            /*
-             * Just ignore the -P argument that is passed by the setup command
-             * line.
-             */
-            if (!args[0].equals("-P")) {
-              displayUsage = true;
-            }
-          } else {
-            displayUsage = true;
-          }
-        }
-      }
-    }
-    return displayUsage;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
   protected void guiLaunchFailed(String logFileName) {
     if (logFileName != null)
     {

--
Gitblit v1.10.0