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

Mark Craig
08.08.2015 393249210669ee74243e155f33d37055efe35c18
CR-6580 OPENDJ-1796 Use static hostname in reference docs

This patch prevents generated man pages
from using the default host name of the build system.
2 files modified
27 ■■■■■ changed files
opendj-cli/src/main/java/com/forgerock/opendj/cli/ArgumentParser.java 21 ●●●●● patch | view | raw | blame | history
opendj-cli/src/main/java/com/forgerock/opendj/cli/SubCommandArgumentParser.java 6 ●●●●● patch | view | raw | blame | history
opendj-cli/src/main/java/com/forgerock/opendj/cli/ArgumentParser.java
@@ -816,6 +816,12 @@
                    continue;
                }
                // Return a generic FQDN for localhost as the default hostname
                // in reference documentation.
                if (isHostNameArgument(a)) {
                    a.setDefaultValue("localhost.localdomain");
                }
                // The help argument should be added at the end.
                if (isUsageArgument(a)) {
                    helpArgument = a;
@@ -845,6 +851,21 @@
    }
    /**
     * Returns true if this argument is for setting a hostname.
     * @param a The argument.
     * @return true if this argument is for setting a hostname.
     */
    boolean isHostNameArgument(final Argument a) {
        final String name = a.getName();
        return name.equalsIgnoreCase(OPTION_LONG_HOST)
                || name.equalsIgnoreCase(OPTION_LONG_REFERENCED_HOST_NAME)
                || name.equalsIgnoreCase("host1")
                || name.equalsIgnoreCase("host2")
                || name.equalsIgnoreCase("hostSource")
                || name.equalsIgnoreCase("hostDestination");
    }
    /**
     * Returns a map containing information about an argument option.
     * @param   a   The argument
     * @return      A map containing information about an argument option
opendj-cli/src/main/java/com/forgerock/opendj/cli/SubCommandArgumentParser.java
@@ -1255,6 +1255,12 @@
            List<Map<String, Object>> options = new LinkedList<Map<String, Object>>();
            String nameOption = null;
            for (Argument a : subCommand.getArguments()) {
                // Return a generic FQDN for localhost as the default hostname
                // in reference documentation.
                if (isHostNameArgument(a)) {
                    a.setDefaultValue("localhost.localdomain");
                }
                Map<String, Object> option = new HashMap<String, Object>();
                String optionSynopsis = getOptionSynopsis(a);
                option.put("synopsis", optionSynopsis);