Properties p = command.getValue();
String description = p.getProperty(descriptionI18n, p.getProperty(descriptionBase));
options.addOption(command.getKey(), false, description);
}
HelpFormatter formatter = new HelpFormatter();
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
String syntax = "openejb <command> [options] [args]";
String header = "\nAvailable commands:";
String footer = "\n" +
"Try 'openejb <command> --help' for help on a specific command.\n" +
"For example 'openejb deploy --help'.\n" +
"\n" +
"Apache OpenEJB -- EJB Container System and Server.\n" +
"For additional information, see http://openejb.apache.org\n" +
"Bug Reports to <users@openejb.apache.org>";
if (!printHeader){
pw.append(header).append("\n\n");
formatter.printOptions(pw, 74, options, 1, 3);
} else {
formatter.printHelp(pw, 74, syntax, header, options, 1, 3, footer, false);
}
pw.flush();
// Fix up the commons-cli output to our liking.