Example usage for org.apache.commons.cli HelpFormatter printWrapped

List of usage examples for org.apache.commons.cli HelpFormatter printWrapped

Introduction

In this page you can find the example usage for org.apache.commons.cli HelpFormatter printWrapped.

Prototype

public void printWrapped(PrintWriter pw, int width, String text) 

Source Link

Document

Print the specified text to the specified PrintWriter.

Usage

From source file:org.sybila.parasim.application.ParasimOptions.java

public static void printVersion(PrintStream out) {
    PrintWriter output = new PrintWriter(out);
    output.println();//from w ww  . j av a  2 s. c o m
    HelpFormatter helpFormatter = new HelpFormatter();
    helpFormatter.printWrapped(output, HelpFormatter.DEFAULT_WIDTH,
            "Parasim CLI " + VERSION + " - tool for parallel simulation and verification ");
    output.flush();
}

From source file:org.vetmeduni.tools.AbstractTool.java

/**
 * Output to System.err the help for this tool (with the full description)
 *///from  w w w . j  av a  2 s . c o  m
protected void help() {
    ToolNames tool = ToolNames.valueOf(this.getClass().getSimpleName());
    HelpFormatter formatter = new HelpFormatter();
    PrintWriter writer = new PrintWriter(System.err);
    Main.printProgramHeader(writer);
    writer.println();
    writer.println(String.format("%s: %s", tool, tool.shortDescription));
    writer.println("---");
    formatter.printWrapped(writer, formatter.getWidth(), tool.fullDescription);
    writer.println("---\n");
    formatter.printHelp(writer, formatter.getWidth(), usage(), "\n", programOptions(),
            formatter.getLeftPadding(), formatter.getDescPadding(), "", true);
    writer.close();
}