substack/minimist — pull request #10 by iwhitfield (2014-04-07 21:12:20+00:00)
Title: Parse arrays from command line via Minimist

Not sure if this is has been previously rejected for a reason (although it isn't as nice as it could be), but this PR adds the ability to detect and parse in an array argument.

```
// { arr: ["some", "array"], _: [] }
--arr [some, array]

// { arr: ["some", "array"], _: [] }
--arr=[some, array]

// { _: [["some", "array"]] }
[some, array]
```

It supports all formats above, and parses in integers/booleans/strings. Tests are included in `test/array.js`.

Due to the shell though, if you want to pass in a string containing spaces in the array, it has to be wrapped in quotes:

```
--arr=["String with spaces"]
```

Feel free to reject this - I just had need of it on my fork so figured I'd open a PR.