org.apache.avalon.excalibur.cli
Class CLArgsParser

java.lang.Object
  |
  +--org.apache.avalon.excalibur.cli.CLArgsParser

public final class CLArgsParser
extends java.lang.Object

Parser for command line arguments. This parses command lines according to the standard (?) of GNU utilities. Note: This is still used in 1.1 libraries so do not add 1.2+ dependencies.

Since:
4.0
Author:
Peter Donald

Inner Class Summary
protected static class CLArgsParser.Token
           
 
Constructor Summary
CLArgsParser(java.lang.String[] args, CLOptionDescriptor[] optionDescriptors)
          Create a parser that deals with options and parses certain args.
CLArgsParser(java.lang.String[] args, CLOptionDescriptor[] optionDescriptors, ParserControl control)
          Create a parser that can deal with options and parses certain args.
 
Method Summary
 java.util.Vector getArguments()
          Retrieve a list of options that were parsed from command list.
 java.lang.String getErrorString()
          Retrieve an error message that occured during parsing if one existed.
 java.lang.String[] getUnparsedArgs()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CLArgsParser

public CLArgsParser(java.lang.String[] args,
                    CLOptionDescriptor[] optionDescriptors,
                    ParserControl control)
Create a parser that can deal with options and parses certain args.
Parameters:
args[] - the args, typically that passed to the public static void main(String[] args) method.
optionDescriptors[] - the option descriptors

CLArgsParser

public CLArgsParser(java.lang.String[] args,
                    CLOptionDescriptor[] optionDescriptors)
Create a parser that deals with options and parses certain args.
Parameters:
args[] - the args
optionDescriptors[] - the option descriptors
Method Detail

getUnparsedArgs

public java.lang.String[] getUnparsedArgs()

getArguments

public java.util.Vector getArguments()
Retrieve a list of options that were parsed from command list.
Returns:
the list of options

getErrorString

public java.lang.String getErrorString()
Retrieve an error message that occured during parsing if one existed.
Returns:
the error string


Copyright © 2001 Apache Jakarta Project. All Rights Reserved.