Minimalist header-only C++17 command line parsing function.
## Background
A C++ program can access the command line with which it was invoked through the `argv` argument of the `main` function, which contains an array of whitespace-separated tokens.
Most programs offer a richer interface than a simple list of values separated by whitespace: a common kind of interface consists in providing the user with a set of options that can be toggled or configured.
Users expect programs to accept those options in a standard format—the GNU/Unix format—according to which the command line is to be parsed.
Parsing the command line is a common task for which many libraries have been created, most notably [getopt](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getopt.html), specified by the POSIX standard and available on most systems, and [Boost.Program\_options](https://www.boost.org/doc/libs/release/doc/html/program_options.html).
Nearly all of these libraries provide developers with a similar interface: you need to first precisely define the list of options that should be accepted by your program, specifying short and long names, accepted format and multiplicity for each one along with a description, then trigger the parsing and get the result inside a special structure.
Those libraries can feel too complex for simple projects and too rigid for quick experimentations, which is what the [Argh!](https://github.com/adishavit/argh) library addresses: its philosophy is to simply provide the developers with direct access to the set of options that were passed, without any kind of prior specification.
## Goal
This library follows the same philosophy as _Argh!_ but with a much lighter implementation, providing developers with a function that directly parses the command line into a dictionary of options in less than 100 lines of code.
## Usage
### Installation
Copy the [options.hpp](options.hpp) header into your project and include it where appropriate.
### Documentation
```cpp
template<typenameIterator>
auto options::parse(Iterator start, Iterator end)
```
**Synopsis:** Parse a list of command line arguments into a set of program options.
This implementation strives to follow (in decreasing precedence) the guidelines laid out in Chapter 12 of the POSIX.1-2017 specification (see <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html>); the conventions of Chapter 10 in “The Art of Unix Programming” by Eric S. Raymond; and the author's personal habits.
**Arguments:**
*`start`: Iterator to the initial argument.
*`end`: Past-the-end iterator to signal the argument list’s end.
**Return value:** A pair with, first: a dictionary containing for each option present on the command line a key-value pair, with the option’s name as the key, and the list of option-arguments associated to that option, following the order of the command line, as the value. If an option has no associated option-arguments (i.e. is a flag), the value in the dictionary is an empty list; second: a list in which all operands are grouped following the order of the command line.