| java.lang.Object org.apache.commons.cli.Options
Options | public class Options (Code) | | Main entry-point into the library.
Options represents a collection of
Option objects, which
describe the possible options for a command-line.
It may flexibly parse long and short options, with or without
values. Additionally, it may parse only a portion of a commandline,
allowing for flexible multi-stage parsing.
See Also: org.apache.commons.cli.CommandLine author: bob mcwhirter (bob @ werken.com) author: James Strachan version: $Revision: 542144 $ |
Constructor Summary | |
public | Options() |
Options | public Options()(Code) | | Construct a new Options descriptor
|
addOption | public Options addOption(String opt, boolean hasArg, String description)(Code) | | Add an option that only contains a short-name.
It may be specified as requiring an argument.
Parameters: opt - Short single-character name of the option. Parameters: hasArg - flag signally if an argument is required after this option Parameters: description - Self-documenting description the resulting Options instance |
addOption | public Options addOption(String opt, String longOpt, boolean hasArg, String description)(Code) | | Add an option that contains a short-name and a long-name.
It may be specified as requiring an argument.
Parameters: opt - Short single-character name of the option. Parameters: longOpt - Long multi-character name of the option. Parameters: hasArg - flag signally if an argument is required after this option Parameters: description - Self-documenting description the resulting Options instance |
addOption | public Options addOption(Option opt)(Code) | | Adds an option instance
Parameters: opt - the option that is to be added the resulting Options instance |
addOptionGroup | public Options addOptionGroup(OptionGroup group)(Code) | | Add the specified option group.
Parameters: group - the OptionGroup that is to be added the resulting Options instance |
getOption | public Option getOption(String opt)(Code) | | Retrieve the named
Option Parameters: opt - short or long name of the Option the option represented by opt |
getOptionGroup | public OptionGroup getOptionGroup(Option opt)(Code) | | Returns the OptionGroup the opt
belongs to.
Parameters: opt - the option whose OptionGroup is being queried. the OptionGroup if opt is partof an OptionGroup, otherwise return null |
getOptionGroups | Collection getOptionGroups()(Code) | | Lists the OptionGroups that are members of this Options instance.
a Collection of OptionGroup instances. |
getOptions | public Collection getOptions()(Code) | | Retrieve a read-only list of options in this set
read-only Collection of Option objects in this descriptor |
getRequiredOptions | public List getRequiredOptions()(Code) | | Returns the required options as a
java.util.Collection .
Collection of required options |
helpOptions | List helpOptions()(Code) | | Returns the Options for use by the HelpFormatter.
the List of Options |
toString | public String toString()(Code) | | Dump state, suitable for debugging.
Stringified form of this object |
|
|