# Installation

Use npm command in order to install the options-parser module:

```bash
npm install [--save] options-parser
```

# Parse your commands

The options-parser class allows the developers to easily parse command line:

  - parse(cmd, settings) : parse "cmd" according to "settings" and return an options mapping:

  Settings format:

  ```json
  {
    "prefix" : "--",
    "strict" : false,
    "options" : {}
  }
  ```
  Strict option determines if the list of available options is free or defined.

  Return format for "--option1 --options2 /var/log":

  ```json
  {
    "option1" : true
    "option2" : "/var/log"
  }
  ```

# Usage example

```js
var assert = require('assert');

var OptionsParserClass = require('options-parser');
var SectionClass = require('bh-section');

var parser = new OptionsParserClass();

var result = parser.parse('--option1 --options2 /var/log', new SectionClass({
  'prefix' : '--',
  'strict' : false,
  'options' : {}
}));

assert.equal(result.options1, true);
assert.equal(result.options2, '/var/log');

```
