org.apache.commons.jelly.util

## Class CommandLineParser

- java.lang.Object
- - org.apache.commons.jelly.util.CommandLineParser

    public class CommandLineParser
    extends java.lang.Object

Utility class to parse command line options using CLI. Using a separate class allows us to run Jelly without CLI in the classpath when the command line interface is not in use.

Version:
  $Revision: 155420 $
Author:
  James Strachan, Morgan Delagrange

### Field Summary

Fields
`protected static CommandLineParser` `_instance`

### Constructor Summary

Constructors
Constructor and Description
`CommandLineParser()`

### Method Summary

Methods
`static CommandLineParser` `getInstance()`
`void` `invokeCommandLineJelly(java.lang.String[] args)` Parse out the command line options and configure the give Jelly instance.
`org.apache.commons.cli.CommandLine` `parseCommandLineOptions(java.lang.String[] args)` Parse the command line using CLI.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### _instance

    protected static CommandLineParser _instance

### Constructor Detail

#### CommandLineParser

    public CommandLineParser()

### Method Detail

#### getInstance

    public static CommandLineParser getInstance()

#### invokeCommandLineJelly

    public void invokeCommandLineJelly(java.lang.String[] args)
                                throws JellyException

Parse out the command line options and configure the give Jelly instance.

Parameters:
  `args` - options from the command line
Throws:
  `JellyException` - if the command line could not be parsed

#### parseCommandLineOptions

    public org.apache.commons.cli.CommandLine parseCommandLineOptions(java.lang.String[] args)
                                                               throws org.apache.commons.cli.ParseException

Parse the command line using CLI. -o and -script are reserved for Jelly. -Dsysprop=sysval is support on the command line as well.

Throws:
  `org.apache.commons.cli.ParseException`