From 4b0e392bba4962a0186dd3710f5def70ab60bcf9 Mon Sep 17 00:00:00 2001
From: Ludovic Poitou <ludovic.poitou@forgerock.com>
Date: Fri, 21 Sep 2012 16:41:52 +0000
Subject: [PATCH] Fix issue OPENDJ-591- dsconfig --quiet isn't when using --batchFilePath. Now quiet is quiet and otherwise, commands are printed in an understandable way.

---
 opendj-sdk/opends/src/server/org/opends/server/util/cli/ConsoleApplication.java |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/util/cli/ConsoleApplication.java b/opendj-sdk/opends/src/server/org/opends/server/util/cli/ConsoleApplication.java
index e6d9cae..f981658 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/util/cli/ConsoleApplication.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/util/cli/ConsoleApplication.java
@@ -23,6 +23,7 @@
  *
  *
  *      Copyright 2008-2010 Sun Microsystems, Inc.
+ *      Portions Copyright 2012 ForgeRock AS
  */
 package org.opends.server.util.cli;
 
@@ -222,6 +223,7 @@
 
     ValidationCallback<Boolean> validator = new ValidationCallback<Boolean>() {
 
+      @Override
       public Boolean validate(ConsoleApplication app, String input) {
         String ninput = input.toLowerCase().trim();
         if (ninput.length() == 0) {
@@ -417,6 +419,19 @@
     }
   }
 
+  /**
+   * Display the batch progress string to the error stream, if we are not
+   * in quiet mode
+   *
+   * @param s
+   *          The string to display
+   */
+  public final void printlnBatchProgress(String s) {
+    if (!isQuiet())
+    {
+      err.println(s);
+    }
+  }
 
   /**
    * Displays a message to the error stream indented by the specified
@@ -605,6 +620,7 @@
   {
     ValidationCallback<Integer> callback = new ValidationCallback<Integer>()
     {
+      @Override
       public Integer validate(ConsoleApplication app, String input)
           throws CLIException
       {
@@ -1171,6 +1187,7 @@
   {
     ValidationCallback<Integer> callback = new ValidationCallback<Integer>()
     {
+      @Override
       public Integer validate(ConsoleApplication app, String input)
           throws CLIException
       {

--
Gitblit v1.10.0