opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Launcher.java
@@ -150,14 +150,20 @@ } /** * Prints a usage message to the terminal and exits * with exit code QuickSetupCli.USER_DATA_ERROR. * @param i18nMsg localized user message that will * be printed to std error * Prints a usage message to the terminal. * @param i18nMsg localized user message that will be printed to the terminal. * @param toStdErr whether the message must be printed to the standard error * or the standard output. */ protected void printUsage(String i18nMsg) { System.err.println(i18nMsg); System.exit(QuickSetupCli.USER_DATA_ERROR); protected void printUsage(String i18nMsg, boolean toStdErr) { if (toStdErr) { System.err.println(i18nMsg); } else { System.out.println(i18nMsg); } } /** @@ -255,14 +261,14 @@ QuickSetupCli cli = new QuickSetupCli(cliApp, args); int returnValue = cli.run(); if (returnValue == QuickSetupCli.USER_DATA_ERROR) { printUsage(); printUsage(true); System.exit(QuickSetupCli.USER_DATA_ERROR); } return returnValue; } /** * Prints the version statement to terminal and exits * with an error code. * Prints the version statement to standard output terminal. */ private void printVersion() { @@ -272,8 +278,10 @@ /** * Prints a usage statement to terminal and exits with an error * code. * @param toStdErr whether the message must be printed to the standard error * or the standard output. */ protected abstract void printUsage(); protected abstract void printUsage(boolean toStdErr); /** * Creates a CLI application that will be run if the @@ -300,15 +308,17 @@ protected abstract void guiLaunchFailed(String logFileName); /** * The main method which is called by the uninstall command lines. * The main method which is called by the command lines. */ public void launch() { if (shouldPrintVersion()) { printVersion(); System.exit(QuickSetupCli.SUCCESSFUL); } else if (shouldPrintUsage()) { printUsage(); printUsage(false); System.exit(QuickSetupCli.SUCCESSFUL); } else if (isCli()) { CliApplication cliApp = createCliApplication(); int exitCode = launchCli(args, cliApp); opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/installer/InstallLauncher.java
@@ -138,6 +138,9 @@ System.out.println(getMsg("setup-launcher-launching-gui")); System.setProperty("org.opends.quicksetup.Application.class", "org.opends.quicksetup.installer.offline.OfflineInstaller"); // TO DELETE System.setProperty("org.opends.quicksetup.Application.class", "org.opends.quicksetup.installandupgrader.InstallAndUpgrader"); } /** @@ -150,7 +153,7 @@ /** * {@inheritDoc} */ public void printUsage() { protected void printUsage(boolean toStdErr) { String scriptName; if (Utils.isWindows()) { scriptName = Installation.WINDOWS_SETUP_FILE_NAME; @@ -264,7 +267,7 @@ argParser.addArgument(showUsage); argParser.setUsageArgument(showUsage); String msg = argParser.getUsage(); printUsage(msg); printUsage(msg, toStdErr); } catch (Throwable t) { opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/uninstaller/UninstallLauncher.java
@@ -127,7 +127,7 @@ /** * {@inheritDoc} */ protected void printUsage() { protected void printUsage(boolean toStdErr) { ArgumentParser argParser = new ArgumentParser(getClass().getName(), getI18n().getMsg("uninstall-launcher-usage-description"), false); BooleanArgument cli; @@ -155,7 +155,7 @@ argParser.setUsageArgument(showUsage); String msg = argParser.getUsage(); printUsage(msg); printUsage(msg, toStdErr); } catch (Throwable t) { opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/UpgradeLauncher.java
@@ -94,7 +94,7 @@ /** * {@inheritDoc} */ protected void printUsage() { protected void printUsage(boolean toStdErr) { ArgumentParser argParser = new ArgumentParser(getClass().getName(), getI18n().getMsg("upgrade-launcher-usage-description"), false); BooleanArgument showUsage; @@ -128,7 +128,7 @@ argParser.setUsageArgument(showUsage); String msg = argParser.getUsage(); printUsage(msg); printUsage(msg, toStdErr); } catch (Throwable t) {