public class CmdLineOption
extends java.lang.Object
| 构造器和说明 |
|---|
CmdLineOption() |
| 限定符和类型 | 方法和说明 |
|---|---|
CmdLineOption |
addOption(java.lang.String opt,
boolean hasArg,
java.lang.String description)
Add an option that only contains a short-name.
|
java.lang.String |
getOptionValue(java.lang.String opt)
Retrieve the first argument, if any, of this option.
|
java.lang.String |
getOptionValue(java.lang.String opt,
java.lang.String dv)
Retrieve the first argument, if any, of this option.
|
java.lang.String[] |
getOptionValues(java.lang.String opt)
Retrieves the array of values, if any, of an option.
|
boolean |
hasOption(java.lang.String opt)
Query to see if an option has been set.
|
CmdLineOption |
parse(java.lang.String[] arguments)
Parse the arguments according to the specified options.
|
public CmdLineOption addOption(java.lang.String opt, boolean hasArg, java.lang.String description)
It may be specified as requiring an argument.
opt - Short single-character name of the option.hasArg - flag signally if an argument is required after this optiondescription - Self-documenting descriptionpublic CmdLineOption parse(java.lang.String[] arguments)
arguments - the command line argumentspublic java.lang.String getOptionValue(java.lang.String opt)
opt - the name of the optionpublic java.lang.String getOptionValue(java.lang.String opt,
java.lang.String dv)
opt - the name of the optiondv - default valuepublic java.lang.String[] getOptionValues(java.lang.String opt)
opt - string name of the optionpublic boolean hasOption(java.lang.String opt)
opt - Short name of the optionCopyright © 2020. All Rights Reserved.