maxogden/dat — pull request #243 by finnp (2014-12-10 12:18:33+00:00)
Title: CLI: Specifying options for help and parsing 

Each command module can now export a `options` array of specified options in the style documented here: https://www.npmjs.com/package/cliclopts

Example for `dat init`:
```js
init.options = [
{
name: 'prompt',
default: true,
boolean: true,
help: 'show prompt'
},
{
name: 'name',
help: 'name of the dat'
},
//...
]
```

This data is used to display options on `dat init`, e.g
```
Usage: dat init
initialize dat store

--prompt show prompt (default: true)
--name name of the dat
--description description of the dat
--publisher publisher of the dat
```

Also defaults, aliases (specified with 'alias' and 'abbr' key) and booleans are parsed and passed to the minimist options. This means that also `--path /test/test` usage without `=` is allowed now, since minimist knows when to parse them as boolean flags.

It's still allowed to use undocumented options. I probably also forgot options for the CLI, but I think it's a good start. Let me know if you find some.