From 426f6fff96db9c07683e5a27b8b745b3e13c29ff Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Fri, 08 Jun 2007 19:15:27 +0000
Subject: [PATCH] This commit address several related issues regarding the upgrader CLI:

---
 opends/src/quicksetup/org/opends/quicksetup/Launcher.java |   32 ++++++++++++++++++--------------
 1 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/opends/src/quicksetup/org/opends/quicksetup/Launcher.java b/opends/src/quicksetup/org/opends/quicksetup/Launcher.java
index 1ced51f..48dbee8 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/Launcher.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/Launcher.java
@@ -252,16 +252,11 @@
    */
   protected int launchCli(String[] args, CliApplication cliApp) {
     System.setProperty("org.opends.quicksetup.cli", "true");
-
     QuickSetupCli cli = new QuickSetupCli(cliApp, args);
     int returnValue = cli.run();
     if (returnValue == QuickSetupCli.USER_DATA_ERROR) {
       printUsage();
     }
-
-    // Add an extra space systematically
-    System.out.println();
-
     return returnValue;
   }
 
@@ -315,8 +310,9 @@
     else if (shouldPrintUsage()) {
       printUsage();
     } else if (isCli()) {
-      int exitCode = launchCli(args, createCliApplication());
-      preExit();
+      CliApplication cliApp = createCliApplication();
+      int exitCode = launchCli(args, cliApp);
+      preExit(cliApp);
       System.exit(exitCode);
     } else {
       willLaunchGui();
@@ -331,20 +327,28 @@
         {
           guiLaunchFailed(null);
         }
-        exitCode = launchCli(args, createCliApplication());
+        CliApplication cliApp = createCliApplication();
+        exitCode = launchCli(args, cliApp);
         if (exitCode != 0) {
-          preExit();
+          preExit(cliApp);
           System.exit(exitCode);
         }
       }
     }
   }
 
-  private void preExit() {
-    File logFile = QuickSetupLog.getLogFile();
-    if (logFile != null) {
-      System.out.println(getMsg("general-see-for-details",
-            QuickSetupLog.getLogFile().getPath()));
+  private void preExit(CliApplication cliApp) {
+    UserData ud = cliApp.getUserData();
+    if (ud != null && !ud.isSilent()) {
+
+      // Add an extra space systematically
+      System.out.println();
+
+      File logFile = QuickSetupLog.getLogFile();
+      if (logFile != null) {
+        System.out.println(getMsg("general-see-for-details",
+              QuickSetupLog.getLogFile().getPath()));
+      }
     }
   }
 

--
Gitblit v1.10.0