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

jvergara
18.58.2008 08b43d500a8aab4d29906c60820ca0983ead359e
Fix for issue 3076 (base64 -V or --version doesn't work)

When the version argument is passed, detect it and print the version.
2 files modified
21 ■■■■■ changed files
opends/src/messages/messages/utility.properties 1 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/util/Base64.java 20 ●●●●● patch | view | raw | blame | history
opends/src/messages/messages/utility.properties
@@ -552,3 +552,4 @@
INFO_ARGPARSER_USAGE_TRAILINGARGS_266={trailing-arguments}
MILD_ERR_CONFIRMATION_TRIES_LIMIT_REACHED_267=Confirmation tries limit reached \
 (%d)
SEVERE_ERR_UNEXPECTED_268=Unexpected error.  Details: %s
opends/src/server/org/opends/server/util/Base64.java
@@ -44,6 +44,7 @@
import org.opends.messages.Message;
import org.opends.messages.MessageBuilder;
import org.opends.server.core.DirectoryServer;
import org.opends.server.types.NullOutputStream;
import org.opends.server.util.args.ArgumentException;
import org.opends.server.util.args.BooleanArgument;
@@ -513,7 +514,7 @@
    }
    SubCommand subCommand = argParser.getSubCommand();
    if (showUsage.isPresent())
    if (argParser.isUsageArgumentPresent())
    {
      if (subCommand == null)
      {
@@ -529,6 +530,23 @@
      return;
    }
    if (argParser.isVersionArgumentPresent())
    {
      // We have to print the version since we have set a NullOutputStream on
      // the parser
      try
      {
        DirectoryServer.printVersion(System.out);
        System.exit(0);
      }
      catch (Throwable t)
      {
        // Bug
        System.err.println(ERR_UNEXPECTED.get(t.toString()).toString());
        System.exit(1);
      }
    }
    if (subCommand == null)
    {
      System.err.println(argParser.getUsage());