Package org.apache.commons.cli
Class HelpFormatter.Builder
java.lang.Object
org.apache.commons.cli.HelpFormatter.Builder
- All Implemented Interfaces:
Supplier<HelpFormatter>
- Enclosing class:
HelpFormatter
Builds
HelpFormatter
.- Since:
- 1.7.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionA function to convert a description (not null) and a deprecated Option (not null) to help descriptionFormatter for deprecated options.private PrintWriter
The output PrintWriter, defaults to wrappingSystem.out
.private boolean
The flag to determine if the since values should be dispalyed -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget()
setPrintWriter
(PrintWriter printWriter) Sets the output PrintWriter, defaults to wrappingSystem.out
.setShowDeprecated
(boolean useDefaultFormat) Sets whether to show deprecated options.setShowDeprecated
(Function<Option, String> deprecatedFormatFunction) Sets whether to show deprecated options.setShowSince
(boolean showSince) Sets whether to show the date the option was first added.
-
Field Details
-
DEFAULT_DEPRECATED_FORMAT
A function to convert a description (not null) and a deprecated Option (not null) to help description -
deprecatedFormatFunction
Formatter for deprecated options. -
printStream
The output PrintWriter, defaults to wrappingSystem.out
. -
showSince
private boolean showSinceThe flag to determine if the since values should be dispalyed
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
get
- Specified by:
get
in interfaceSupplier<HelpFormatter>
-
setPrintWriter
Sets the output PrintWriter, defaults to wrappingSystem.out
.- Parameters:
printWriter
- the output PrintWriter, not null.- Returns:
this
instance.
-
setShowDeprecated
Sets whether to show deprecated options.- Parameters:
useDefaultFormat
- iftrue
use the default format, otherwise clear the formatter.- Returns:
this
instance.
-
setShowDeprecated
Sets whether to show deprecated options.- Parameters:
deprecatedFormatFunction
- Specify the format for the deprecated options.- Returns:
this
instance.- Since:
- 1.8.0
-
setShowSince
Sets whether to show the date the option was first added.- Parameters:
showSince
- if @{code true} the date the options was first added will be shown.- Returns:
- this builder.
- Since:
- 1.9.0
-