private void dumpUsage(PrintStream output) { final String cmdName = "dumpapp"; HelpFormatter formatter = new HelpFormatter(); output.println("Usage: " + cmdName + " [options] <plugin> [plugin-options]"); PrintWriter writer = new PrintWriter(output); try { formatter.printOptions( writer, formatter.getWidth(), mGlobalOptions.options, formatter.getLeftPadding(), formatter.getDescPadding()); } finally { writer.flush(); } } }
printOptions(pw, width, options, leftPad, descPad);
/** * Prints the info about a command to the given print writer. * * @param command command to print info * @param pw where to print the info */ public static void printCommandInfo(Command command, PrintWriter pw) { String description = String.format("%s: %s", command.getCommandName(), command.getDescription()); int width = 80; try { width = TerminalFactory.get().getWidth(); } catch (Exception e) { // In case the terminal factory failed to decide terminal type, use default width } HELP_FORMATTER.printWrapped(pw, width, description); HELP_FORMATTER.printUsage(pw, width, command.getUsage()); if (command.getOptions().getOptions().size() > 0) { HELP_FORMATTER.printOptions(pw, width, command.getOptions(), HELP_FORMATTER.getLeftPadding(), HELP_FORMATTER.getDescPadding()); } }
HelpFormatter fmt = new HelpFormatter(); PrintWriter pw = new PrintWriter(System.out); fmt.printOptions(pw, columns, theCommand.getOptions(), 2, 2); pw.flush();
protected static void usage(Options options) { HelpFormatter helpFormatter = new HelpFormatter(); PrintWriter writer = new PrintWriter(System.out); helpFormatter.printUsage(writer, 80, RunSesamePersonManipulator.class.getSimpleName(), options); helpFormatter.printOptions(writer, 80, options, 1, 2); writer.flush(); }
@Override void printUsage(String cmd) { super.printUsage(cmd + ((options == null) ? "" : " [options]")); if (options != null) { System.out.println("Options:"); HelpFormatter formatter = new HelpFormatter(); PrintWriter pw = new PrintWriter(System.out); formatter.printOptions(pw, 80, options, 4, 4); pw.flush(); } }
protected static void usage(Options options) { HelpFormatter helpFormatter = new HelpFormatter(); PrintWriter writer = new PrintWriter(System.out); helpFormatter.printUsage(writer, 80, Augmenter.class.getSimpleName(), options); helpFormatter.printOptions(writer, 80, options, 1, 2); writer.flush(); }
protected static void usage(Options options) { HelpFormatter helpFormatter = new HelpFormatter(); PrintWriter writer = new PrintWriter(System.out); helpFormatter.printUsage(writer, 80, OrcidZipToHBase.class.getSimpleName(), options); helpFormatter.printOptions(writer, 80, options, 1, 2); writer.flush(); }
private void usage(Options options) { HelpFormatter helpFormatter = new HelpFormatter(); PrintWriter writer = new PrintWriter(System.out); helpFormatter.printUsage(writer, 80, CLI.class.getSimpleName(), options); helpFormatter.printOptions(writer, 80, options, 1, 2); writer.flush(); }
private void usage(Options options) { HelpFormatter helpFormatter = new HelpFormatter(); PrintWriter writer = new PrintWriter(System.out); helpFormatter.printUsage(writer, 80, CmdlineEditor.class.getSimpleName(), options); helpFormatter.printOptions(writer, 80, options, 1, 2); writer.flush(); }
protected static void usage(Options options) { HelpFormatter helpFormatter = new HelpFormatter(); PrintWriter writer = new PrintWriter(System.out); helpFormatter.printUsage(writer, 80, RunCatalogToSesame.class.getSimpleName(), options); helpFormatter.printOptions(writer, 80, options, 1, 2); writer.flush(); }
protected static void usage(Options options) { HelpFormatter helpFormatter = new HelpFormatter(); PrintWriter writer = new PrintWriter(System.out); helpFormatter.printUsage(writer, 80, TransferYaddaPackToSesame.class.getSimpleName(), options); helpFormatter.printOptions(writer, 80, options, 1, 2); writer.flush(); }
protected static void usage(Options options) { HelpFormatter helpFormatter = new HelpFormatter(); PrintWriter writer = new PrintWriter(System.out); helpFormatter.printUsage(writer, 80, RunKimToSesameImporter.class.getSimpleName(), options); helpFormatter.printOptions(writer, 80, options, 1, 2); writer.flush(); }
protected static void usage(Options options) { HelpFormatter helpFormatter = new HelpFormatter(); PrintWriter writer = new PrintWriter(System.out); helpFormatter.printUsage(writer, 80, DescriptorBasedRepoExporter.class.getSimpleName(), options); helpFormatter.printOptions(writer, 80, options, 1, 2); writer.flush(); }
protected static void usage(Options options) { HelpFormatter helpFormatter = new HelpFormatter(); PrintWriter writer = new PrintWriter(System.out); helpFormatter.printUsage(writer, 80, AdaBoostWeightAssignatorRunner.class.getSimpleName(), options); helpFormatter.printOptions(writer, 80, options, 1, 2); writer.flush(); }
protected static void usage(Options options) { HelpFormatter helpFormatter = new HelpFormatter(); PrintWriter writer = new PrintWriter(System.out); helpFormatter.printUsage(writer, 80, PersonDirectoryCreatorRunner.class.getSimpleName(), options); helpFormatter.printOptions(writer, 80, options, 1, 2); writer.flush(); }
@Override public void printHelpExtra(PrintStream out, List args) { HelpFormatter formatter = new HelpFormatter(); PrintWriter writer = new PrintWriter(out); writer.println("> -----"); writer.println(getCommandDescriptions()); // formatter.printHelp(writer, 80, getCommandDescriptions(), ">>>", getOptions(), 4, 4, ">>>", true); formatter.printOptions(writer, 80, getOptions(), 4, 4); writer.println("> -----"); writer.flush(); }
public void printHelp(String cmdLineSyntax, String header, Options options, Options debugOptions) { super.printHelp(cmdLineSyntax, header, options, ""); if (debugOptions != null) { System.out.println(); System.out.println("Debug Options:"); PrintWriter pw = new PrintWriter(System.out); super.printOptions(pw, getWidth(), debugOptions, getLeftPadding(), getDescPadding()); pw.flush(); } } }
public void printHelp(String cmdLineSyntax, String header, Options options, Options debugOptions) { super.printHelp(cmdLineSyntax, header, options, ""); if (debugOptions != null) { System.out.println(); System.out.println("Debug Options:"); PrintWriter pw = new PrintWriter(System.out); super.printOptions(pw, getWidth(), debugOptions, getLeftPadding(), getDescPadding()); pw.flush(); } } }
public static void printCommandUsage(String name, Options options, String usageFooter, PrintStream err) { HelpFormatter formatter = new HelpFormatter(); PrintWriter writer = new PrintWriter(err); formatter.printUsage(writer, 80, TOOL_NAME + " [OPTIONS] " + name, getOptionsWithHelp(options)); formatter.printWrapped(writer, 80, System.lineSeparator() + "Available options are:" + System.lineSeparator()); formatter.printOptions(writer, 80, getScriptOptions(), formatter.getLeftPadding(), formatter.getDescPadding()); formatter.printWrapped(writer, 80, System.lineSeparator() + "Available arguments are:" + System.lineSeparator()); formatter.printOptions(writer, 80, getOptionsWithHelp(options), formatter.getLeftPadding(), formatter.getDescPadding()); formatter.printWrapped(writer, 80, System.lineSeparator() + Objects.toString(usageFooter, "")); writer.flush(); }