opends/src/server/org/opends/server/tools/dsconfig/DSConfig.java
@@ -544,7 +544,8 @@ * @throws ArgumentException * If a global argument could not be registered. */ private void initializeGlobalArguments() throws ArgumentException { private void initializeGlobalArguments(String[] args) throws ArgumentException { if (globalArgumentsInitialized == false) { verboseArgument = new BooleanArgument("verbose", 'v', "verbose", INFO_DESCRIPTION_VERBOSE.get()); @@ -619,6 +620,7 @@ // Register any global arguments required by the management // context factory. factory.setRawArguments(args); factory.registerGlobalArguments(parser); globalArgumentsInitialized = true; @@ -706,7 +708,7 @@ private int run(String[] args) { // Register global arguments and sub-commands. try { initializeGlobalArguments(); initializeGlobalArguments(args); initializeSubCommands(); } catch (ArgumentException e) { Message message = ERR_CANNOT_INITIALIZE_ARGS.get(e.getMessage()); opends/src/server/org/opends/server/tools/dsconfig/InternalManagementContextFactory.java
@@ -22,7 +22,7 @@ * CDDL HEADER END * * * Copyright 2007-2008 Sun Microsystems, Inc. * Copyright 2007-2009 Sun Microsystems, Inc. */ package org.opends.server.tools.dsconfig; @@ -105,4 +105,11 @@ return new CommandBuilder(null, null); } /** * {@inheritDoc} */ public void setRawArguments(String[] args) { // No implementation required. } } opends/src/server/org/opends/server/tools/dsconfig/LDAPManagementContextFactory.java
@@ -59,6 +59,7 @@ import java.util.LinkedHashSet; import javax.net.ssl.SSLException; import javax.net.ssl.SSLHandshakeException; import org.opends.server.tools.ToolConstants; /** @@ -79,6 +80,9 @@ // This CLI is always using the administration connector with SSL private boolean alwaysSSL = false; // Raw arguments private String[] rawArgs = null; /** * Creates a new LDAP management context factory. * @@ -323,7 +327,13 @@ return context; } /** * {@inheritDoc} */ public void setRawArguments(String[] args) { this.rawArgs = args; } /** * {@inheritDoc} @@ -343,7 +353,16 @@ try { secureArgsList.initArgumentsWithConfiguration(); if (rawArgs != null) { for (String rawArg : rawArgs) { if (rawArg.contains(ToolConstants.OPTION_LONG_HELP) || (rawArg.charAt(1) == ToolConstants.OPTION_SHORT_HELP) || (rawArg. charAt(1) == '?')) { // used for usage default values only secureArgsList.initArgumentsWithConfiguration(); } } } } catch (ConfigException ce) { opends/src/server/org/opends/server/tools/dsconfig/ManagementContextFactory.java
@@ -22,7 +22,7 @@ * CDDL HEADER END * * * Copyright 2007-2008 Sun Microsystems, Inc. * Copyright 2007-2009 Sun Microsystems, Inc. */ package org.opends.server.tools.dsconfig; @@ -88,6 +88,14 @@ /** * Set the raw arguments (used for default value setting). * * @param args raw arguments. */ public void setRawArguments(String[] args); /** * Validates any global arguments passed to the application. * Implementations of this method should check that the values * passed to their global arguments are valid and are not