/** * Displays help for the specified Server launcher command to standard err. If the Server launcher * command is unspecified, then usage information is displayed instead. * * @param command the Server launcher command in which to display help information. * @see #usage() */ public void help(final Command command) { if (Command.isUnspecified(command)) { usage(); } else { info(wrap(helpMap.get(command.getName()), 80, "")); info("\n\nusage: \n\n"); info(wrap("> java ... " + getClass().getName() + ' ' + usageMap.get(command), 80, "\t\t")); info("\n\noptions: \n\n"); for (final String option : command.getOptions()) { info(wrap("--" + option + ": " + helpMap.get(option) + '\n', 80, "\t")); } info("\n\n"); } }
/** * Determines whether the given Server launcher command has been properly specified. The command * is deemed unspecified if the reference is null or the Command is UNSPECIFIED. * * @param command the Server launcher command. * @return a boolean value indicating whether the Server launcher command is unspecified. * @see Command#UNSPECIFIED */ public static boolean isUnspecified(final Command command) { return command == null || command.isUnspecified(); }