org.apache.commons.cli

Class HelpFormatter


public class HelpFormatter
extends Object

A formatter of help messages for the current command line options
Authors:
Slawek Zachcial
John Keyes (john at integralsource.com)

Nested Class Summary

private static class
HelpFormatter.StringBufferComparator

Field Summary

static String
DEFAULT_ARG_NAME
static int
DEFAULT_DESC_PAD
static int
DEFAULT_LEFT_PAD
static String
DEFAULT_LONG_OPT_PREFIX
static String
DEFAULT_OPT_PREFIX
static String
DEFAULT_SYNTAX_PREFIX
static int
DEFAULT_WIDTH
String
defaultArgName
int
defaultDescPad
int
defaultLeftPad
String
defaultLongOptPrefix
String
defaultNewLine
String
defaultOptPrefix
String
defaultSyntaxPrefix
int
defaultWidth

Constructor Summary

HelpFormatter()

Method Summary

protected String
createPadding(int len)
protected int
findWrapPos(String text, int width, int startPos)
Finds the next text wrap position after startPos for the text in sb with the column width width.
void
printHelp(PrintWriter pw, int width, String cmdLineSyntax, String header, Options options, int leftPad, int descPad, String footer)
void
printHelp(PrintWriter pw, int width, String cmdLineSyntax, String header, Options options, int leftPad, int descPad, String footer, boolean autoUsage)
void
printHelp(String cmdLineSyntax, String header, Options options, String footer)
void
printHelp(String cmdLineSyntax, String header, Options options, String footer, boolean autoUsage)
void
printHelp(String cmdLineSyntax, Options options)
void
printHelp(String cmdLineSyntax, Options options, boolean autoUsage)
void
printHelp(int width, String cmdLineSyntax, String header, Options options, String footer)
void
printHelp(int width, String cmdLineSyntax, String header, Options options, String footer, boolean autoUsage)
void
printOptions(PrintWriter pw, int width, Options options, int leftPad, int descPad)
void
printUsage(PrintWriter pw, int width, String cmdLineSyntax)
void
printUsage(PrintWriter pw, int width, String app, Options options)
Prints the usage statement for the specified application.
void
printWrapped(PrintWriter pw, int width, String text)
void
printWrapped(PrintWriter pw, int width, int nextLineTabStop, String text)
protected StringBuffer
renderOptions(StringBuffer sb, int width,