From db1a3826ba28aa6231756ebd224f16677440ed2e Mon Sep 17 00:00:00 2001
From: Gaetan Boismal <gaetan.boismal@forgerock.com>
Date: Tue, 01 Mar 2016 09:43:01 +0000
Subject: [PATCH] OPENDJ-2701 status command using -n fails if no password is provided

---
 opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/CommonArguments.java |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/CommonArguments.java b/opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/CommonArguments.java
index 63f0a7d..ce34201 100644
--- a/opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/CommonArguments.java
+++ b/opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/CommonArguments.java
@@ -418,9 +418,27 @@
      *             If there is a problem with any of the parameters used to create this argument.
      */
     public static StringArgument bindDNArgument(final String defaultBindDN) throws ArgumentException {
+        return bindDNArgument(defaultBindDN, INFO_DESCRIPTION_BINDDN.get());
+    }
+
+
+    /**
+     * Returns the "bindDN" string argument. <br/>
+     * <i> N.B : the 'D' short option is also used by rootUserDN.</i>
+     *
+     * @param defaultBindDN
+     *            The default bind DN.
+     * @param description
+     *            The localized description to print in help messages.
+     * @return The "bindDN" argument.
+     * @throws ArgumentException
+     *             If there is a problem with any of the parameters used to create this argument.
+     */
+    public static StringArgument bindDNArgument(final String defaultBindDN, final LocalizableMessage description)
+            throws ArgumentException {
         return StringArgument.builder(OPTION_LONG_BINDDN)
                 .shortIdentifier(OPTION_SHORT_BINDDN)
-                .description(INFO_DESCRIPTION_BINDDN.get())
+                .description(description)
                 .defaultValue(defaultBindDN)
                 .valuePlaceholder(INFO_BINDDN_PLACEHOLDER.get())
                 .buildArgument();

--
Gitblit v1.10.0