Package org.apache.commons.cli
Class CommandLine.Builder
java.lang.Object
org.apache.commons.cli.CommandLine.Builder
- All Implemented Interfaces:
Supplier<CommandLine>
- Enclosing class:
CommandLine
A nested builder class to create
CommandLine
instance using descriptive methods.- Since:
- 1.4
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Builder
Deprecated.Constructs a new instance.
-
-
Method Details
-
addArg
Adds left-over unrecognized option/argument.- Parameters:
arg
- the unrecognized option/argument.- Returns:
- this Builder instance for method chaining.
-
addOption
Adds an option to the command line. The values of the option are stored.- Parameters:
option
- the processed option.- Returns:
- this Builder instance for method chaining.
-
build
Deprecated.Useget()
.Creates a new instance.- Returns:
- a new instance.
-
get
Creates a new instance.- Specified by:
get
in interfaceSupplier<CommandLine>
- Returns:
- a new instance.
- Since:
- 1.10.0
-
setDeprecatedHandler
Sets the deprecated option handler.- Parameters:
deprecatedHandler
- the deprecated option handler.- Returns:
this
instance.- Since:
- 1.7.0
-
CommandLine.builder()
.