public abstract class BaseOption extends BaseArgument
| Modifier | Constructor and Description |
|---|---|
protected |
BaseOption(String name,
String shortNames,
String metaVar,
String usage,
String defaultValue,
boolean repeated,
boolean required,
boolean hidden) |
| Modifier and Type | Method and Description |
|---|---|
abstract int |
apply(ArgumentList args)
Parse the argument list, including the argument string that triggered
the call.
|
abstract int |
applyShort(String opts,
ArgumentList args)
When handling a list of short options, except for the last short
option.
|
String |
getMetaVar()
Meta variable to show in usage printout.
|
String |
getPrefix()
Prefix part of the usage usage message.
|
String |
getShortNames()
Each character of the shortNames string is handled as a short option
that is parsed with the -[short] style.
|
String |
getSingleLineUsage()
Get the argument's single line usage string.
|
protected String |
nameOrShort()
Handy getter mostly to be used in exception naming.
|
getDefaultValue, getName, getUsage, isHidden, isRepeated, isRequired, validatepublic String getShortNames()
public String getMetaVar()
public String getSingleLineUsage()
BaseArgumentgetSingleLineUsage in class BaseArgumentpublic String getPrefix()
BaseArgumentgetPrefix in class BaseArgumentpublic abstract int applyShort(String opts, ArgumentList args)
opts - The remaining characters of the short opt list.args - The list of arguments including the short opt list.public abstract int apply(ArgumentList args)
apply in class BaseArgumentargs - The list of arguments.ArgumentException - If the passed arguments are not valid.protected String nameOrShort()
Copyright © 2016. All rights reserved.