Clone this repository
For self-hosted knots, clone URLs may differ based on your setup.
Download tar.gz
An empty long-form switch (`--`) is commonly used to end argument parsing and
formard the remaining arguments verbatim to the next step in the pipeline.
Since this is just a toy parser, it will simply ignore the double dash for the
time being.
Argument ingestion is not happening anyway, since the parsed arguments remain
in the `argv` array.
Unlike flags, key=value arguments allow the association of arbitrary string
values to named keys.
To set a value on a named key, pass an argument of the type `key=value`:
```bash
$ node command first=1 second=2 third=three
```
This will set the following values on the named keys:
- first: "1"
- second: "2"
- third: "three"
Note that there is no attempt of parsing the values at all so far.
Also, the key name is not allowed to be empty, the following argument will be
silently ignored:
```bash
$ node command =some-value
```
This adds support for long-form switches; a long-form switch works similarly
to a flag switch, but the switch itself is identified by a string encompassing
multiple characters.
To enable a long-form switch, pass its name preceded by a double dash, like so:
```bash
$ node program --long-form-switch
```
Since long-form switches can have arbitrarily long names, they can't be grouped
like flag switches are, and each switch requires a new argument:
```bash
$ node program --switch-one --switch-two
```