Home » commons-cli-1.1-src » org.apache.commons » cli » [javadoc | source]
org.apache.commons.cli
public class: CommandLine [javadoc | source]
java.lang.Object
   org.apache.commons.cli.CommandLine

Represents list of arguments parsed against a Options descriptor.

It allows querying of a boolean #hasOption(String opt) , in addition to retrieving the #getOptionValue(String opt) for options requiring arguments.

Additionally, any left-over or unrecognized arguments, are available for further processing.

Constructor:
 CommandLine() 
Method from org.apache.commons.cli.CommandLine Summary:
addArg,   addOption,   getArgList,   getArgs,   getOptionObject,   getOptionObject,   getOptionValue,   getOptionValue,   getOptionValue,   getOptionValue,   getOptionValues,   getOptionValues,   getOptions,   hasOption,   hasOption,   iterator
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.commons.cli.CommandLine Detail:
  void addArg(String arg) 
    Add left-over unrecognized option/argument.
  void addOption(Option opt) 
    Add an option to the command line. The values of the option are stored.
 public List getArgList() 
    Retrieve any left-over non-recognized options and arguments
 public String[] getArgs() 
    Retrieve any left-over non-recognized options and arguments
 public Object getOptionObject(String opt) 
    Return the Object type of this Option.
 public Object getOptionObject(char opt) 
    Return the Object type of this Option.
 public String getOptionValue(String opt) 
    Retrieve the argument, if any, of this option.
 public String getOptionValue(char opt) 
    Retrieve the argument, if any, of this option.
 public String getOptionValue(String opt,
    String defaultValue) 
    Retrieve the argument, if any, of an option.
 public String getOptionValue(char opt,
    String defaultValue) 
    Retrieve the argument, if any, of an option.
 public String[] getOptionValues(String opt) 
    Retrieves the array of values, if any, of an option.
 public String[] getOptionValues(char opt) 
    Retrieves the array of values, if any, of an option.
 public Option[] getOptions() 
    Returns an array of the processed Option s.
 public boolean hasOption(String opt) 
    Query to see if an option has been set.
 public boolean hasOption(char opt) 
    Query to see if an option has been set.
 public Iterator iterator() 
    Returns an iterator over the Option members of CommandLine.