Interface CommandLine
public interface CommandLine
Represents the parsed command line options.
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceCommandLine.Builder<T extends CommandLine.Builder>A build for constructing a command line parser. -
Method Summary
Modifier and TypeMethodDescriptionstatic CommandLine.Builderbuild()Build and parse a new command line.String[]boolean@Nullable ObjectoptionValue(String name) The value of an option.static CommandLineParse a new command line with the default options.Parses a newCommandLineinstance that combines this instance with the given arguments.
-
Method Details
-
getRemainingArgs
-
getSystemProperties
Properties getSystemProperties()- Returns:
- The system properties specified
-
getOptions
-
hasOption
- Parameters:
name- The name of the option- Returns:
- Whether the given option is specified
-
optionValue
-
lastOption
-
getRemainingArgsString
String getRemainingArgsString()- Returns:
- The remaining args as one big string
-
getRemainingArgsWithOptionsString
String getRemainingArgsWithOptionsString()- Returns:
- The remaining args as one big string without undeclared options
-
getUndeclaredOptions
-
parseNew
Parses a newCommandLineinstance that combines this instance with the given arguments.- Parameters:
args- The arguments- Returns:
- A new
CommandLineinstance
-
getRawArguments
String[] getRawArguments()- Returns:
- The raw unparsed arguments
-
build
-
parse
Parse a new command line with the default options.- Parameters:
args- The arguments- Returns:
- The command line
-