public class Option extends BaseOption
| Constructor and Description |
|---|
Option(String name,
String shortNames,
String metaVar,
String usage,
Consumer<String> setter) |
Option(String name,
String shortNames,
String metaVar,
String usage,
Consumer<String> setter,
String defaultValue) |
Option(String name,
String shortNames,
String metaVar,
String usage,
Consumer<String> setter,
String defaultValue,
boolean repeated,
boolean required,
boolean hidden) |
| Modifier and Type | Method and Description |
|---|---|
int |
apply(ArgumentList args)
Parse the argument list, including the argument string that triggered
the call.
|
int |
applyShort(String opts,
ArgumentList args)
When handling a list of short options, except for the last short
option.
|
void |
validate()
Called on all the arguments after the parsing is done to validate
if all requirements have been passed.
|
getMetaVar, getPrefix, getShortNames, getSingleLineUsage, nameOrShortgetDefaultValue, getName, getUsage, isHidden, isRepeated, isRequiredpublic Option(String name, String shortNames, String metaVar, String usage, Consumer<String> setter)
public Option(String name, String shortNames, String metaVar, String usage, Consumer<String> setter, String defaultValue)
public int applyShort(String opts, ArgumentList args)
BaseOptionapplyShort in class BaseOptionopts - The remaining characters of the short opt list.args - The list of arguments including the short opt list.public void validate()
throws ArgumentException
BaseArgumentArgumentException if is did not validate with the appropriate
error message.validate in class BaseArgumentArgumentExceptionpublic int apply(ArgumentList args) throws ArgumentException
BaseOptionapply in class BaseOptionargs - The list of arguments.ArgumentException - If the passed arguments are not valid.Copyright © 2016. All rights reserved.