/** * Displays help for the specified Locator launcher command to standard err. If the Locator * launcher command is unspecified, then usage information is displayed instead. * * @param command the Locator 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 (String option : command.getOptions()) { info(wrap("--" + option + ": " + helpMap.get(option) + "\n", 80, "\t")); } info("\n\n"); } }
/** * Determines whether the given Locator launcher command has been properly specified. The * command is deemed unspecified if the reference is null or the Command is UNSPECIFIED. * * @param command the Locator launcher command. * @return a boolean value indicating whether the Locator launcher command is unspecified. * @see Command#UNSPECIFIED */ public static boolean isUnspecified(final Command command) { return (command == null || command.isUnspecified()); }