mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
20.22.2015 7d7590eeec89384877a3074092b49b16f60fccb8
OPENDJ-1955 dsconfig --displayCommand does not display the complete equivalent command

DSConfig.java:
In getCommandBuilder(), added back the line "commandBuilder.append(handler.getCommandBuilder())" lost after r10676
1 files modified
16 ■■■■■ changed files
opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/DSConfig.java 16 ●●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/DSConfig.java
@@ -1311,29 +1311,32 @@
     * Updates the command builder with the global options: script friendly, verbose, etc. for a given sub command. It
     * also adds systematically the no-prompt option.
     *
     * @param <T>
     *            SubCommand type.
     * @param subCommand
     *            The sub command handler or common.
     * @return <T> The builded command.
     */
    <T> CommandBuilder getCommandBuilder(final T subCommand) {
    CommandBuilder getCommandBuilder(final Object subCommand) {
        final String commandName = getScriptName();
        final SubCommandHandler handler;
        final String subCommandName;
        if (subCommand instanceof SubCommandHandler) {
            subCommandName = ((SubCommandHandler) subCommand).getSubCommand().getName();
            handler = (SubCommandHandler) subCommand;
            subCommandName = handler.getSubCommand().getName();
        } else {
            handler = null;
            subCommandName = (String) subCommand;
        }
        final CommandBuilder commandBuilder = new CommandBuilder(commandName, subCommandName);
        if (handler != null) {
            commandBuilder.append(handler.getCommandBuilder());
        }
        if (factory != null && factory.getContextCommandBuilder() != null) {
            commandBuilder.append(factory.getContextCommandBuilder());
        }
        if (verboseArgument.isPresent()) {
            commandBuilder.addArgument(verboseArgument);
        }
        if (scriptFriendlyArgument.isPresent()) {
            commandBuilder.addArgument(scriptFriendlyArgument);
        }
@@ -1343,7 +1346,6 @@
        if (propertiesFileArgument.isPresent()) {
            commandBuilder.addArgument(propertiesFileArgument);
        }
        if (noPropertiesFileArgument.isPresent()) {
            commandBuilder.addArgument(noPropertiesFileArgument);
        }