diff --git a/README.md b/README.md index 50db570..8d5385f 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,25 @@ A very simple Options parser and command-line arguments handling library for PHP. +## Table of Contents + + +* [OptsLib](#optslib) + * [Table of Contents](#table-of-contents) + * [Installation](#installation) + * [Compiling from source](#compiling-from-source) + * [Usage](#usage) + * [parseArgument()](#parseargument--) + * [getArguments()](#getarguments--) + * [Additional functionality](#additional-functionality) + * [getRegex()](#getregex--) + * [setRegex()](#setregex--) + * [getArgsCache()](#getargscache--) + * [License](#license) + * [Contributing](#contributing) + * [Contact](#contact) + + ## Installation The library can be installed using ncc: @@ -115,6 +134,39 @@ In this case, you can pass the `subcommand` argument to the echo $arguments['username']; // "test" ``` +## Additional functionality + +### getRegex() + +This method is used to return the regex pattern used to parse +the arguments, it can be used to parse arguments manually. + +The default used is + +```regexp +/(?(?=-)-(?(?=-)-(?'bigflag'[^\\s=]+)|(?'smallflag'\\S))(?:\\s*=\\s*|\\s+)(?(?!-)(?(?=[\\\"\\'])((?