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

Mark Craig
08.08.2015 393249210669ee74243e155f33d37055efe35c18
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