Home » commons-cli-1.1-src » org.apache.commons » cli » [javadoc | source]
public class: Options [javadoc | source]

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.

 public Options() 
Method from org.apache.commons.cli.Options Summary:
addOption,   addOption,   addOption,   addOptionGroup,   getOption,   getOptionGroup,   getOptionGroups,   getOptions,   getRequiredOptions,   hasOption,   helpOptions,   toString
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.commons.cli.Options Detail:
 public Options addOption(Option opt) 
    Adds an option instance
 public Options addOption(String opt,
    boolean hasArg,
    String description) 
    Add an option that only contains a short-name. It may be specified as requiring an argument.
 public Options addOption(String opt,
    String longOpt,
    boolean hasArg,
    String description) 
    Add an option that contains a short-name and a long-name. It may be specified as requiring an argument.
 public Options addOptionGroup(OptionGroup group) 
    Add the specified option group.
 public Option getOption(String opt) 
 public OptionGroup getOptionGroup(Option opt) 
    Returns the OptionGroup the opt belongs to.
 Collection getOptionGroups() 
    Lists the OptionGroups that are members of this Options instance.
 public Collection getOptions() 
    Retrieve a read-only list of options in this set
 public List getRequiredOptions() 
    Returns the required options as a java.util.Collection.
 public boolean hasOption(String opt) 
 List helpOptions() 
    Returns the Options for use by the HelpFormatter.
 public String toString() 
    Dump state, suitable for debugging.