public final class ArgumentGroupImpl extends Object implements ArgumentGroup, MutuallyExclusiveGroup
| Modifier and Type | Method and Description |
|---|---|
ArgumentImpl |
addArgument(String... nameOrFlags)
Creates new
Argument, adds it to this container and returns it. |
ArgumentGroupImpl |
description(String description)
Sets the description for the arguments of this container.
|
List<ArgumentImpl> |
getArgs() |
boolean |
isRequired() |
void |
printHelp(PrintWriter writer,
int format_width) |
ArgumentGroupImpl |
required(boolean required)
If
true is given, one of the arguments in this group must be
specified otherwise error will be issued. |
public ArgumentGroupImpl description(String description)
ArgumentContainerdescription in interface ArgumentContainerdescription in interface ArgumentGroupdescription in interface MutuallyExclusiveGroupdescription - The description of this container.public ArgumentImpl addArgument(String... nameOrFlags)
ArgumentContainer
Creates new Argument, adds it to this container and returns it.
The nameOrFlags is either a single name of positional argument or
a list of option strings for named argument, e.g. foo or
-f, --foo.
addArgument in interface ArgumentContainernameOrFlags - A name or a list of option strings of new Argument.Argument object.public ArgumentGroupImpl required(boolean required)
MutuallyExclusiveGroup
If true is given, one of the arguments in this group must be
specified otherwise error will be issued.
The default value is false.
required in interface MutuallyExclusiveGrouprequired - true or falsepublic void printHelp(PrintWriter writer, int format_width)
public boolean isRequired()
public List<ArgumentImpl> getArgs()
Copyright © 2012–2017. All rights reserved.