Package joptsimple
Class BuiltinHelpFormatter
java.lang.Object
joptsimple.BuiltinHelpFormatter
- All Implemented Interfaces:
HelpFormatter
public class BuiltinHelpFormatter extends java.lang.Object implements HelpFormatter
A help formatter that allows configuration of overall row width and column separator width.
The formatter produces a two-column output. The left column is for the options, and the right column for their descriptions. The formatter will allow as much space as possible for the descriptions, by minimizing the option column's width, no greater than slightly less than half the overall desired width.
-
Constructor Summary
Constructors Constructor Description BuiltinHelpFormatter(int desiredOverallWidth, int desiredColumnSeparatorWidth)
Makes a formatter with a given overall row width and column separator width. -
Method Summary
Modifier and Type Method Description java.lang.String
format(java.util.Map<java.lang.String,? extends OptionDescriptor> options)
Produces help text, given a set of option descriptors.
-
Constructor Details
-
BuiltinHelpFormatter
public BuiltinHelpFormatter(int desiredOverallWidth, int desiredColumnSeparatorWidth)Makes a formatter with a given overall row width and column separator width.- Parameters:
desiredOverallWidth
- how many characters wide to make the overall help displaydesiredColumnSeparatorWidth
- how many characters wide to make the separation between option column and description column
-
-
Method Details
-
format
public java.lang.String format(java.util.Map<java.lang.String,? extends OptionDescriptor> options)Description copied from interface:HelpFormatter
Produces help text, given a set of option descriptors.- Specified by:
format
in interfaceHelpFormatter
- Parameters:
options
- descriptors for the configured options of a parser- Returns:
- text to be used as help
- See Also:
OptionParser.printHelpOn(java.io.Writer)
,OptionParser.formatHelpWith(HelpFormatter)
-