maxogden/dat — pull request #231 by finnp (2014-12-03 01:25:24+00:00)
Title: Usage information for each command with --help / -h

This is a proposal on how to have a consistent `--help` flag for each command. Similar to how `npm` does it, each command is a module that also exports a `usage` string key. This gets automatically printed on `dat --help` (if available)

I also moved all double-commands like `dat blobs put` and `dat blobs get` to be submodules of `dat blobs`. For those cases the blobs.js module exports a function on `.usage` which gets the args as an input and can return the usage string for the appropriate subcommand.

So `dat rows` no longer shows `command not available` put instead prints usage informations instead.

Also the dat command itself shows this now:
```
$ dat
Usage: dat []

where is one of:
cat
export
import
init
help
version
pull
push
clean
clone
serve
listen
blobs
rows

Enter 'dat -h' for usage information
For an introduction to dat see 'dat help'
```