com.pimeca.waster
Class CmdLineHandler

java.lang.Object
  extended by com.pimeca.waster.CmdLineHandler

public class CmdLineHandler
extends java.lang.Object

wrapper for a command line with GNUParser Appache commons-cli

Author:
maurel

Field Summary
private  org.apache.commons.cli.CommandLine cmdLine
           
private  int ERROR_EXIT_VALUE
           
 
Constructor Summary
private CmdLineHandler()
           
  CmdLineHandler(java.lang.String[] args)
          parsing arguments
 
Method Summary
protected  org.apache.commons.cli.CommandLine getCommandLine()
           
private  org.apache.commons.cli.Options getOptions()
          creates org.apache.commons.cli.Options for the command line class
private  org.apache.commons.cli.CommandLine parse(org.apache.commons.cli.Options options, java.lang.String[] input)
          parse with Posix parser.
private  void printHelp()
          print help statement to standard output
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERROR_EXIT_VALUE

private final int ERROR_EXIT_VALUE
See Also:
Constant Field Values

cmdLine

private org.apache.commons.cli.CommandLine cmdLine
Constructor Detail

CmdLineHandler

private CmdLineHandler()

CmdLineHandler

public CmdLineHandler(java.lang.String[] args)
parsing arguments

Parameters:
args - command line
Method Detail

getCommandLine

protected org.apache.commons.cli.CommandLine getCommandLine()

parse

private org.apache.commons.cli.CommandLine parse(org.apache.commons.cli.Options options,
                                                 java.lang.String[] input)
parse with Posix parser. Print help and exit if aster command file name not found

Parameters:
options - command line options
input - command line input
Returns:
parsed command line

getOptions

private org.apache.commons.cli.Options getOptions()
creates org.apache.commons.cli.Options for the command line class

Returns:
options

printHelp

private void printHelp()
print help statement to standard output